XML Validation problem Processing Instructions/Comments within elements

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hello,
Im using the XmlReader class to validate an XML file that has an element with maxLength attribute set to 20. When I put something like this:

<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; <<span style="color:#A31515; XPTO<span style="color:Blue; >155077505124368<?tibco-char 0?>












<span style="color:Blue; </<span style="color:#A31515; XPTO<span style="color:Blue; >
[/code]

the length exception doesnt get thrown, it just ignores any whitespace after the processing instruction. If I place something like this:


<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; <<span style="color:#A31515; XPTO<span style="color:Blue; >155077505124368<?tibco-char 0?> 1

<span style="color:Blue; </<span style="color:#A31515; XPTO<span style="color:Blue; >
[/code]

Then the validation works! I think this is by design... I would like to know why and if theres any workaround for the problem!

Thank you very much,


View the full article
 
Back
Top