Oh, a book about XSLT, that's really something I could need now for my Work! So, my questions about the XSLT 2.0 Web Development book: 1) What does can XSLT2 do better as XSLT ? 2) are there processor ready for XSLT2 (under linux, since thats the only platform I'm using?) 3) Something else about xslt : I've got a Problem, when extracting commentaries from an xslt file. I don't know why, using : <xsl:select="task/comment()"> <xsl:value-of="."/> </xsl:select> only extracts the first comment is under <task>. Why? And how can I change that ?
3) oh, I wanted to write <xsl:for-each> in my sample. I didn't take care.
the comment template lloks like that :
and then... even then using <xsl:for-each>, and I don't know why, xslt is only extracting the first commentary from the input file under /project/file/
what I want to do is : extract all comments from an ant build-file (these are xml files), and create an html file with anotation for all ant-targets with anotation (thats why I need to extract the commentaries) from that xml document - a little bit like javadoc. do you know what is wrong in this code ?
do you have any recommendations on designing XML schemata which make the resulting XML more suitable for XSLT processing? Is there such a thing as a well-formed XML file some pieces of which cause problems or even can not be processed with XSLT? Thanks.
Daniel: <xsl:for-each select="."> iterates only once, probably it's not what you have in mind. Make a template with match="comment()", and then inside the /project/target template, call it thus:
No need to do any for-each; this will run the comment template on all children of the current node for whom the value of of comment() is true, i.e. for all comments.
Pradeep: in fact most XSLT implementations are written in Java: Saxon, Xalan, XT, jd-xslt...
Dmitry: XSLT is a programming language, so the question of "what XML is best for XSLT" has only one answer: that depends on how you program your stylesheet. The only requierement is that the source is well-formed so it can parse; other than that it's up to you. Your starting point is the structure and meaning of your data; design both your schema and your XSLT to best fit the data, not each other.
Water! People swim in water! Even tiny ads swim in water: