BizTalk Utilities CV ,   Jobs ,   Code library
 
Home Page


Add/Edit your code items
Search the code library
Browse for the code library


JavaScript
Begginers, search the Bible
JavaScript Ticker (using Tabular Data Control)
-postfix.aspx>Infix <> Postfix
Nested Tables And Data Island
XML Data Traversal
TrimWhiteSpace
Two Tier Data Islands with Expanding/Collapsing Child elements.
Escape special characters using JavaScript and regular expressions
Sticky Table Headers
Dynamically Filling HTML Select Box from XML Data Island using Javascript.
XML Basics Handbook


 
 

 LAMP >>


By Andreas
First Posted 08/28/2002
Times viewed 200

How to understand the flow of control in XLST


Summary Addendum to "Binding XML Data Island to Web Forms". My first steps in understanding and debugging XLST.

This morning I found an article from Chris Dorsey Binding XML Data Island to Web Forms http://www.topxml.com/code/default.asp?p=3&id=v20020826232101&ms=10&l=xsl&sw=lang in this section. I started learning XML/XLST/DOM/data islands this weekend. Although I am an experienced programmer and I read some books in the last time the learning curve for XML/XLST was not very steep. But from this example I learned a lot. So much that I would say there are some unnecessary templates in the XSL file. Also text nodes in the root node are not handled. To avoid the long lines I wrote two named templates. IMHO this is more handy. The style of writing the templates seems to be at least obscure. But I didn't know how to write the code so that no line feeds are produced. I changed the XLST and appended it as the first part. I also appended second XLST file for understanding and debugging of the original script and this did the trick for me. The first time I was able to predict what will happen. Of course in the frame of my limited knowledge. Thanks to Chris for his really helpful example. P.S. It may be obvious but I used this script for testing this case. If course the HTML structure is destroyed with the second XLST file. DIM xscrc,xstl set xsrc = CreateObject(MSXML2.DOMDocument.4.0) xsrc.async = false xsrc.load WScript.Arguments.Item(0) set xstl = CreateObject(MSXML2.DOMDocument.4.0) xstl.async = false xstl.load WScript.Arguments.Item(1) wscript.echo xsrc.transformNode(xstl) and with cscript test.vbs //NOLOGO test.xml test.xlst I get the transformation results.

/[~ /[~/@
Additional information
updateAttribute('',this) text

... END ...xsl:template match="*[text()~" ...TEXT NODE ... ... START ...xsl:template match="@*" ...ATTRIBUT NODE ... ... END ...xsl:template match="@*" ...ATTRIBUT NODE ... /[~ /[~/@

Further additional information
updateAttribute('',this) text


Rate this article on a scale of 1 to 10 (0 votes, average 0)

Your vote :  

 LAMP >>





Leave a comment for this article
Your name
Your email (optional)
Your comment
Optional: Upload an attachment
Enter the code shown:

 
 

    Email TopXML