On 09/05/2016 17:15, Peter Uhnák wrote:
I re-read this thread three times and I am confused. Is there a way to just ignore the whitespace?
The XML contains doctype (<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">) so maybe that's why it's broken?
But if I understand correctly, the _correct_ way to solve this is not to ignore the whitespace on parse time, but on processing time, correct?
Peter
Hi, What I did to ignore whitespace was to add a DTD in the XML: '<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE System [ <!ELEMENT System (Clones*)> <!ATTLIST System Name CDATA #REQUIRED> <!ATTLIST System Sliding-Window-Size CDATA #IMPLIED> <!ATTLIST System Min-Nbr-Cloned-Locations CDATA #REQUIRED> <!ATTLIST System Min-Fragment-Size CDATA #REQUIRED> <!ATTLIST System Code CDATA #REQUIRED> <!ATTLIST System Cleaner CDATA #REQUIRED> <!ELEMENT Clones (ClonedFragment*)> <!ELEMENT ClonedFragment (Member*)> <!ATTLIST ClonedFragment cloneName CDATA #REQUIRED> <!ATTLIST ClonedFragment cloneHash CDATA #REQUIRED> <!ELEMENT Member EMPTY> <!ATTLIST Member fileName CDATA #REQUIRED> <!ATTLIST Member startLine CDATA #REQUIRED> <!ATTLIST Member endLine CDATA #REQUIRED> ]> <!--clones description file--> <System Name="Mantis" Code="0" Sliding-Window-Size="4" Min-Nbr-Cloned-Locations="2" Min-Fragment-Size="10" Cleaner="DPDummyCleaner"> <Clones> <ClonedFragment cloneName="modified name" cloneHash="1784404950000220151828"> <Member fileName="ProgramA" startLine="2" endLine="5" /> <Member fileName="ProgramB" startLine="2" endLine="5" /> </ClonedFragment> <ClonedFragment cloneName="Code Fragment 2" cloneHash="2440719450000130430812"> <Member fileName="ProgramA" startLine="1" endLine="4" /> <Member fileName="ProgramB" startLine="1" endLine="4" /> </ClonedFragment> </Clones> </System>' White this DTD the parser know that I do not want the whitespaces. -- Cyril Ferlicot http://www.synectique.eu 165 Avenue Bretagne Lille 59000 France