Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / .NET SDK / June 2004

Tip: Looking for answers? Try searching our database.

Transforming Xslt File prior to transformation.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
- 03 Jun 2004 20:37 GMT
In ASP 3.0 and MSXMLHTTP2 we would load Our Xslt file as an XmlDocument. We
then merely had to set the language and we could then execute Expath queries
against the document. This is especially useful for performing actions upon
Xslt Nodes that cannot be done through variables. After modifying the
Document via DOM one could then Transform it agianst the Xml and get the
expected results.

I am looking for a way to have this same functionality in C#/ASP.NET. I know
how to use the XsltTransform Below is sample asp 3.0 code - the
functionality that i am attempting to duplicate in C# is the
     set firstNameNode = xslDoc.selectNodes("//*[name()='xsl:sort']")
Where i grab all the sort nodes as XmlNodes that are modifyable

Below is the ASP 3.0 code
I am having difficulty seeing exactly how this can be achieved with
' Create XML and XSLT Document
 Set xmlDoc  = Server.Createobject("MSXML2.DOMDocument.4.0")
 Set xslDoc  = Server.Createobject("MSXML2.DOMDocument.4.0")
' Load up XML Data
 xmlFile = Server.MapPath("TheData.xml")
 xmlDoc.async = false
 xmlDoc.load(xmlFile)
' Load up XSLT Value
 xslFile = Server.MapPath("OurXsltFile.xsl")
 xslDoc.async = false
 xslDoc.load(xslFile)
'  xslDoc.setProperty
"SelectionNamespaces","xmlns:xsl='http://www.w3.org/1999/XSL/Transform'" '
force it to use hack
 xslDoc.setProperty "SelectionLanguage","XPath"

 set firstNameNode = xslDoc.selectNodes("//*[name()='xsl:sort']")
' Code to modify the nodeList setting attributes we need
- 03 Jun 2004 20:52 GMT
Subject should actually read
Modifying Xslt Nodes priot to Transformation
> In ASP 3.0 and MSXMLHTTP2 we would load Our Xslt file as an XmlDocument.
> We then merely had to set the language and we could then execute Expath
[quoted text clipped - 29 lines]
>  set firstNameNode = xslDoc.selectNodes("//*[name()='xsl:sort']")
> ' Code to modify the nodeList setting attributes we need
- 03 Jun 2004 21:36 GMT
I think i have it sorted
> Subject should actually read
> Modifying Xslt Nodes priot to Transformation
[quoted text clipped - 32 lines]
>>  set firstNameNode = xslDoc.selectNodes("//*[name()='xsl:sort']")
>> ' Code to modify the nodeList setting attributes we need
"Ying-Shen Yu[MSFT]" - 04 Jun 2004 02:18 GMT
Hi,
This KB Article might be helpful to you:
<HOW TO: Implement Common MSXML Tasks in System.xml By Using Visual C# .NET>
http://support.microsoft.com/?id=330589
If you still have problem on this issue please feel free to reply this
thread.
Thanks!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft Community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.
- 04 Jun 2004 02:21 GMT
I solved it by using Loading the Xslt Document, Modifying the Xslt nodes i
needed and then creating a node reader from the document and then Loading
the NodeReader with Transform. I just needed to read a tinytidbit on
somebodys blogs that the XmlNodeReader could be used in replace of (2 other
things)

s
> Hi,
> This KB Article might be helpful to you:
[quoted text clipped - 14 lines]
> This mail should not be replied directly, please remove the word "online"
> before sending mail.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.