subclassing xmlReader issues

Tech-Archive recommends: Speed Up your PC by fixing your registry



I have created a subclass of xmlReader and was passing that in to
XPathDocument and using that XPathDocument instance in my
xslCompiledTransform transform() method. Something about my reader causes
the xslCompiledTransform to behave differently in reading xml attributes
depending on whether I am debugging the xsl or not.
I declared all of abstract methods and I don't get any errors building
my new xmlReader class. I get no exceptions when using it to parse my xml
document and while debugging I can see my xml attributes. But when I try to
use it with or without visual studio and XslCompiledTransform(false) I get
no values returned for my xml attributes.
When I step through the xsl file:
=================================================
1 xmlReader = New XmlData2010SASDataReader(FilePath)
2
3 doc = New XPathDocument(xmlReader)
4 XMLNavigator = doc.CreateNavigator
5 xslDoc = New XslCompiledTransform(false)
6 xslDoc.Load(xslPath)
7 xslDoc.Transform(doc, New XsltArgumentList(), Response.Output)
==================================================
In Visual Studio line 3 does all of the activity of reading the xmlReader
and going through it's methods and getting correct values for elements and
attributes but I get no activity for reading xmlReader in line 7.
I am using a SortedDictionary object to store my attributes while on an
element. The element and attributes are encapsulated in another state
object
that the xmlReader subclass (XmlData2010SASDataReader) uses in all of the
overridden abstract methods of XMLReader superclass (GetAttribute(string),
MoveToFirstAttribute(), etc).
My getAttribute(int) transports all my key/value pairs to an array so
that I can present the relevant attribute.

I have recompiled my custom XMLReader class twice:
1) I put a lock on the sortedDictionary object in the various methods that
utilizes it.
2) I put a lock on the custom class that XmlData2010SASDataReader uses for
element information within XmlData2010SASDataReader's accessor methods.
Neither changed the behavior.
Maybe the SortDictionary object is not safe for this kind of setting.
Any ideas or thoughts? How I can trace back to my problem?

below is a sample snippet of what I am trying to do:

<xsl:variable nme="aname">
<xsl:for-each select="/Root/test">
<xsl:sort select="@attr1" />
<xsl:copy-of select="." />
</xsl:for-each >
</xsl:variable>

In this case it would just build the collection in the same order as the
original children set because it doesn't actually see the attribute values.
So for this xml:
<Root>
<test attr1="avalue" />
<test attr1="anothervalue" />
</Root>
I get this sorted set:
<test attr1="avalue" />
<test attr1="anothervalue" />

Which is not really sorted.
For more background please see the posting in the XSL group posted on
8/26/2008 title " Different XPath testing behavior when using
xslCompiledTransform(t in XSL" .

.



Relevant Pages

  • Re: subclassing xmlReader issues
    ... The sorted Dictionary is part of my debugging efforts. ... not sorted and and I get empty string on all attributes of all xml elements. ... that overload the xmlreader superclass methods. ... Subclasses of this CustomXmlReader ...
    (microsoft.public.dotnet.xml)
  • RE: Ignore previous posting Re: subclassing xmlReader issues
    ... I think it is not related to xmlReader at all, i use similar code and it ... XslCompiledTransform class, the attributes' values will be empty. ... not sorted and and I get empty string on all attributes of all xml elements. ... public abstract class CustomXmlReader: XmlReader ...
    (microsoft.public.dotnet.xml)
  • Ignore previous posting Re: subclassing xmlReader issues
    ... The sorted Dictionary is part of my debugging efforts. ... not sorted and and I get empty string on all attributes of all xml elements. ... public abstract class CustomXmlReader: XmlReader ...
    (microsoft.public.dotnet.xml)
  • Re: Daten aus SQL in XML ausgeben
    ... die If Klausel befindet sich also in einem Try Catch Konstrukt ... Die Ausgabe ist doch aber durch For Xml - im Xml Format ??? ... geht XMLReader trotzdem nicht? ... XMLWriter habe ich heute auch schon ausprobiert... ...
    (microsoft.public.de.german.entwickler.dotnet.datenbank)
  • Re: ReadXML Illegal characters in path
    ... public static XmlReader G2 ... using (SqlConnection connection = new SqlConnection(conn)) ... xml RAW", connection); ... not sure why you let the data base return XML at all, ...
    (microsoft.public.dotnet.xml)