I'm trying to use the XSLT Visualizer with a query result that contains an xml column type. The relevant part of the table definition is:
[CountryCode] [char](2) NOT NULL,
[PostCode] [nvarchar](20) NULL,
[Region] [nvarchar](25) NULL,
[Municipality] [nvarchar](25) NULL,
[DeliveryAddress] [xml] NULL,
The 'Show XML Source' button on the settings page shows the following:
<DocumentElement>
<QueryResults>
<CountryCode>US</CountryCode>
<PostCode>38117</PostCode>
<Region>TN</Region>
<Municipality>Memphis</Municipality>
<DeliveryAddress><Address><Line>c/o John Doe</Line><Line>123 Main St</Line><Unit>4th Floor</Unit><City>Memphis</City><State>TN</State><PostalCode>38117</PostalCode></Address></DeliveryAddress>
</QueryResults>
</DocumentElement>
I tried using the HTML Decode converter on DeliveryAddress but it didn't help.
I spent a little time looking at the source code but I'm going to need to get the source installed so I can step through it in VS it or generate some trace output to figure this out. Before doing that I thought I'd ask for some thoughts on what's causing this and potential workarounds.
- It appears to be the DataTable.WriteXml method that's encoding the value of that column.
- Even with the htmldecode converter there is a single child node of DeliveryAddress that is a text() node.
- I tried msxml:node-set() in the xslt stylesheet but it just returns a text node. It doesn't parse and load it as an XML document or fragment.
- I tried adding script to the stylesheet to actually load it into an XPathDocument and return an XPathNodeIterator but I get a script not allowed error because the Reports module isn't enabling script execution for the transformation.
Any thoughts on how I should proceed?
Thanks, Paul