jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (JCR-1767) XML serialization in JDK 1.4 broken (mostly for WebDAV)
Date Tue, 25 Nov 2008 13:31:45 GMT

     [ https://issues.apache.org/jira/browse/JCR-1767?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jukka Zitting resolved JCR-1767.
--------------------------------

    Resolution: Fixed

Fixed in revision 720492.

> XML serialization in JDK 1.4 broken (mostly for WebDAV)
> -------------------------------------------------------
>
>                 Key: JCR-1767
>                 URL: https://issues.apache.org/jira/browse/JCR-1767
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-jcr-commons
>            Reporter: Julian Reschke
>            Assignee: Jukka Zitting
>            Priority: Minor
>             Fix For: 1.5.0
>
>
> WebDAV uses XmlRequestEntity for serializing XML, which in turn uses org.apache.jackrabbit.commons.xml.SerializingContentHandler
to work around the JDK 1.4 problem (serializing in absence of explicit namespace declarations).
> The following test fails under JDK 1.4, but passed with newer JDKs:
>     public void testXmlSerialization() throws ParserConfigurationException, IOException,
SAXException {
>         
>         DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
>         dbf.setNamespaceAware(true);
>         DocumentBuilder db = dbf.newDocumentBuilder();
>         
>         Document doc = db.newDocument();
>         doc.appendChild(doc.createElementNS("DAV:", "propfind"));
>         
>         XmlRequestEntity xmlent = new XmlRequestEntity(doc);
>         ByteArrayOutputStream bos = new ByteArrayOutputStream();
>         xmlent.writeRequest(bos);
>         
>         Document doc2 = db.parse(new ByteArrayInputStream(bos.toByteArray()));
>         Element docelem = doc2.getDocumentElement();
>         assertEquals("DAV:", docelem.getNamespaceURI());
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message