[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XSLT Concepts
On 01/10/2010 13:50, chirag matkar wrote:
Hello Friends, I am an Amateur Developer in Xsl transformations. I work on Research Article XML conversions. I just want to be clear on some Concepts of XSLT. the first concept that you need to be clear on is that XSLt never processors tags (neither on input nor output) the tags that (may) appear in an impyt file are processed by an XML parser which produces a tree of nodes (actually it may produce a stream of events made into a tree later but that's an implementation detail)
No (conceptually, and usually in practice) the entire input document has been parsed into an in memory node tree before the transformation starts.
xsl:value-of produces a text node with the string value of the nodes that are selected. if you consider that to be junk then presumably you are not selecting the nodes that you want to select, but since you give no information it is impossible to give any advice.
Example - we need to tag article title which appears at end in the input file but we wish to have it tagged first in the output file.ie change order of tags according to our requirements. lots of ways, please read the posting guidelines for this list, which suggests ways to make it easier for people to help. Specifically providing small runnable examples. One way, if you have added <foo>....</foo> at the end of your output file, then in the template for the parent of foo, use <xsl:apply-templates select="* except foo"/> so foo is not processed at that point. and in the template where you want foo to appear at the start of your document do <xsl:apply-templates select="//foo"/> as noted in the reply to your first question, the entire input document is made into a tree in advance so every template has read access to the entire document.
You can never match tags at all, the XSLT processor has no information about the tagging used in the document, it can not tell if you used <p/> (one tag) or <p></p> (two tags). You can apply templates to element nodes as often as you want, either with the same mode (if you want the same processing each time) or different modes 9if you want different processing.
David ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|