Xml:stylesheet and the "The ':' character, hexadecimal" exception

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I am trying to load an xml file that has the following structure:
<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; <?<span style="color:#A31515; xml <span style="color:Red; version<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; 1.0<span style="color:Black; " <span style="color:Red; encoding<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; UTF-8<span style="color:Black; " <span style="color:Blue; ?>
<?xml:stylesheet type="text/xsl link_to_my_stle" ?>
<span style="color:Blue; <<span style="color:#A31515; root<span style="color:Blue; >
... Content here ...
<span style="color:Blue; </<span style="color:#A31515; root<span style="color:Blue; >
[/code]
But when i am doing this:
<div style="color:Black;background-color:White; <pre>
XPathDocument doc = <span style="color:Blue; new XPathDocument(currentFile);
[/code]
I get the following error: The : character, hexadecimal value 0x3A, cannot be included in a name. Line 2, position 6. As i notice this happends because my stylesheet tag contains :.
Is there any way to remove this tag or ignore it to load my file without performing transformations on the document?

View the full article
 
Back
Top