You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Michael Glavassevich <mr...@ca.ibm.com> on 2009/07/12 19:02:03 UTC

Re: Parsing

Hi Amogh,

(You should ask usage question on j-users@xerces.apache.org)

The content for an XML-aware application is the same. Whitespace at
top-level and the ordering of attributes (which have no order anyway) are
generally considered to be formatting. What you're asking for cannot be
achieved with Xerces or any of the standard APIs I know of.

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

"Paradkar, Amoug" <Am...@frx.com> wrote on 06/30/2009 10:03:52 AM:

> Hi,
>
> I had a question regarding parsing of XML files using XML Xerces
> Parser. Actually I am importing an XML file using a tool named
> ?Webtop?, and after exporting it from the tool, size of the XML file
> gets reduced and it makes small change to the file that is exported.
>
> Original file has (before importing to Webtop) : <?xml version="1.0"
> encoding="UTF-8"?>
> <?xml-stylesheet type="text/xsl" href="http://www.fda.
> gov/oc/datacouncil/stylesheets/spl/spl.xsl"?>
> <document xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3
> http://www.fda.gov/oc/datacouncil/schemas/spl/spl.xsd" xmlns:
> voc="urn:hl7-org:v3/voc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
> ">
>
> Exported file from Webtop is: <?xml version="1.0" encoding="UTF-8"?>
> <?xml-stylesheet type="text/xsl" href="http://www.fda.
> gov/oc/datacouncil/stylesheets/spl/spl.xsl"?><document xsi:
> schemaLocation="urn:hl7-org:v3 http://www.fda.
> gov/oc/datacouncil/schemas/spl/spl.xsd" xmlns="urn:hl7-org:v3"
> xmlns:voc="urn:hl7-org:v3/voc" xmlns:xsi="http://www.w3.
> org/2001/XMLSchema-instance">
>
> It is shuffling the contents of <document> tag and ignores the
> whitespace between <?xml-stylesheet?> and <document> tag which can
> be seen in original file.
> Actually my goal is that both the files should be exactly similar,
> that is it should not make any changes after the file is imported,
> keeping same contents.
>
> Any help regarding this doubt will be really appreciated.
>
> Sincerely,
> Amogh Paradkar