473,406 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Resolved XSLT

When you create an XslTransform object, you do a load with the Starting
XML object and an XmlUrlResolver. The Idea is that it will resolve all
of the imports and includes. I would like to see what the resulting XML
looks like, (after it has been all resolved and stuff). I think I am
using the wrong objects because when I do:

string Filename = "Some Stylesheet.xsl";
XmlTextReader txtReader = new
XmlTextReader(HttpContext.Current.Server.MapPath(F ilename));
XmlValidatingReader reader = new XmlValidatingReader(txtReader);
XmlUrlResolver resolver = new XmlUrlResolver();
reader.XmlResolver = resolver;

There is no way to see the OuterXML, (ReadOuterXml do not do what I
expected). I just want it to dump out the XML so I can take a look at
it. Just like when you do an XmlDocument.OuterXml. The XmlWriter doesn't
seem to have anything useful for this either. Any thoughts?

-Cam

Nov 15 '05 #1
5 1194
Hi Cam

Thank you for posting in the community!

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you want to view the OuterXml from an
XmlTextReader. If there is any misunderstanding, please feel free to let me
know.

I have checked the code you have provided. We need to add a little more to
the code to read the outer xml. We have to call MoveToContent method to
move the current pointer to the node that has contents. Here I have add
some code.

string Filename = "Some Stylesheet.xsl";
XmlTextReader txtReader = new
XmlTextReader(HttpContext.Current.Server.MapPath(F ilename));
XmlValidatingReader reader = new XmlValidatingReader(txtReader);
XmlUrlResolver resolver = new XmlUrlResolver();
reader.XmlResolver = resolver;

reader.MoveToFirstAttribute();
string s = reader.ReadOuterXml();

HTH. Does this answer your question? If anything is unclear, please feel
free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 15 '05 #2
Hi Cam,

Thank you for posting in the community!

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you want to view the OuterXml from an
XmlTextReader. If there is any misunderstanding, please feel free to let me
know.

I have checked the code you have provided. We need to add a little more to
the code to read the outer xml. We have to call MoveToContent method to
move the current pointer to the node that has contents. Here I have add
some code.

string Filename = "Some Stylesheet.xsl";
XmlTextReader txtReader = new
XmlTextReader(HttpContext.Current.Server.MapPath(F ilename));
XmlValidatingReader reader = new XmlValidatingReader(txtReader);
XmlUrlResolver resolver = new XmlUrlResolver();
reader.XmlResolver = resolver;

reader.MoveToContent();
string s = reader.ReadOuterXml();

HTH. Does this answer your question? If anything is unclear, please feel
free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 15 '05 #3
Hi Cam,

I'd like to know if the issue has been resoved yet. Is there anything that
I can help on this? I'm still monitoring on it. If you have any further
questions about this issue, please reply to the post in newsgroup.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 15 '05 #4
I guess so. It didn't do what I expected.

I thought the XML from the included, (imports and includes), would
actually be combined into the 'resolved' xslt document. But it was not,
or at least not when it was displayed - assuming it all there in some
internal representation.

-Cam

Kevin Yu [MSFT] wrote:
Hi Cam,

I'd like to know if the issue has been resoved yet. Is there anything that
I can help on this? I'm still monitoring on it. If you have any further
questions about this issue, please reply to the post in newsgroup.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."


Nov 15 '05 #5
Hi Cam,

I'm not quite sure about your meaning in your last post. Do you mean that
the XML document is not correctly resolved? If the XML document isn't
resolved properly, there might be something wrong with the XSL. Please try
to check if the XSL is correct according to the XML document.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 15 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: ted | last post by:
Was wondering if XSLT alone is appropriate for the following situation. From XML, I'm creating a small website (around 50 pages) with pages that link to each other through a nav menu and a...
2
by: Tom Corcoran | last post by:
I am working to ease updating of a html page by transforming 2 xml files. I was going to use xslt for this and had bought 2 unopened books, wrox xslt and o'reilly's xslt cookbook. But am now...
1
by: Mohit | last post by:
Hi Friends I have to call 1 of the 2 child XSLT files from the Main XSLT file based on some criteria. I want one child XSLT file will be executed by version 1 of XSLT processor and the other by...
2
by: Pavel | last post by:
Greetings to all - I'm having a problem processing xml with relative dtd URI specified using XSLT: <?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE mydoc SYSTEM "my.dtd"> <mydoc> .......
3
by: Teksure | last post by:
Hi group, searching in the Internet I found two products for XML which incorporate a very robust debugger for XSL/XSLT, I would like you to see these products and then, give me your opinion about...
1
by: Sergey Dubinets | last post by:
In effort to prioritize our goals we composed the list of random features each of them may add value to set of XSLT tools offered from Microsoft. 1. XSLTc (Compiler for XSLT...
12
by: Chris | last post by:
Hi, Just wondering if anyone out there knows if it is possible to convert a CSV to xml using XSLT? I've seen a lot of examples of xml to CSV, but is it possible to go back the other way? I...
3
by: amanjsingh | last post by:
Hi, I am trying to implement Java Web Service using Apache Axis2 and Eclipse as a tool. I have created the basic code and deployed the service using various eclipse plugin but when I try to invoke...
2
jkmyoung
by: jkmyoung | last post by:
Here's a short list of useful xslt general tricks that aren't taught at w3schools. Attribute Value Template Official W3C explanation and example This is when you want to put dynamic values...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.