poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "PJ Fanning (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (XMLBEANS-538) Unable to parse a Node with a Doctype
Date Thu, 14 Mar 2019 04:51:00 GMT

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

PJ Fanning resolved XMLBEANS-538.
---------------------------------
    Resolution: Fixed

> Unable to parse a Node with a Doctype
> -------------------------------------
>
>                 Key: XMLBEANS-538
>                 URL: https://issues.apache.org/jira/browse/XMLBEANS-538
>             Project: XMLBeans
>          Issue Type: Bug
>    Affects Versions: Version 3.0.2
>            Reporter: Thorsten Goetzke
>            Assignee: PJ Fanning
>            Priority: Major
>             Fix For: Version 3.0.3
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> XmlBeans is unable to handle a org.w3c.dom.Document that uses a Doctype Declaratiion.
It works if the xml is passed as a String.
> {code:java}
> import org.apache.xmlbeans.XmlObject;
> import org.junit.Test;
> import org.w3c.dom.Document;
> import javax.xml.parsers.DocumentBuilder;
> import javax.xml.parsers.DocumentBuilderFactory;
> import java.io.ByteArrayInputStream;
> import java.nio.charset.StandardCharsets;
> public class SvgGraphicImplTest {
>     @Test
>     public void parseIT() throws Exception {
>         final String svgDocumentString = "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n"
+
>                 "\"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n" +
>                 "<svg />";
>         XmlObject.Factory.parse(svgDocumentString); //it works as a String
>         final DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
>         final DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
>         final Document parse = documentBuilder.parse(new ByteArrayInputStream(svgDocumentString.getBytes(StandardCharsets.US_ASCII)));
>         XmlObject.Factory.parse(parse);  //this doesnt'
>     }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message