there isn't a FORECASTDETAIL within the context /FORECAST/ITEM/MONTH.
You have two for-each loops inside each other, and the first one is superceeding the second's context.
Think again about how you should be accessing FORCASTDETAIL.
Cheers
Matt
hmmm just had another thought.. don't know how efficient it is but assuming the current input document is called "myinput.xml" and the other xml doc is called "theother.xml" you could do this:
<xsl:for-each select="document('theother.xml')/*">
<xsl:value-of...
found this:
http://www.xslt.com/html/xsl-list/2005-02/msg01155.html
which says doing it the other way around, and storing your current document in a variable
..
<xsl:variable name="inputdoc" select="/"/>
..
still not found a non-variable method yet
hmm why not refer to document in a variable?
<xsl:variable name="myextdoc">
<xsl:copy-of select="document('mydoc.xml')"/>
</xsl:variable>
....
<xsl:for-each select="$myextdoc/*"/>
<xsl:value-of select="internal-node/*[local-name()=./text()"/>
</xsl:for-each>
...
however i'm still looking...
[cont again]
Interoperability. I can take XML from one company, and transform the data I want to see from that data.
Not only does XLST work on web pages, but it can transform the data into practically any format. So, for example, I could potentially have a list of prices delivered as XML...
[continued] So, the benefits generally are that your program logic isn't intertwined with the way you display your data on the page.
For small apps, its not really a problem, but when it comes to altering a table or layout or an entire column or something, you will have to change the way your...
Basically, XSLT allows you to abstract your data transformation a level away from your data processing/app logic.
So, in your example, PHP can continue to deal with application flow/control and data requisition whilst XSLT can be used on the final data (XML) to decide how everything will look.
i can't find anything on the internet that states xsltproc supports xslt 2.0 anywhere, so theres probably no point in moving to another box.
you could just use vi's search/replace in the xml to replace all the _'s or pre-remove these _'s when you generate? the xml
Or, just install the java sdk...
but you must be using some sort of transformation engine to do the transform?
can you give me an example of what you are writing in the shell to do this plz.
answer:
you can do either.
if its a particularly large set of data, use xpath and Dom Document methods to select the correct XML snippet and then transform it using xslt (i am guessing its marginally faster this way).
or
if its a small xml file, just use xslt to transform the bit of the...
use
<?xml version="1.0"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="course">
<xsl:value-of select="tokenize(., '_+')"/>
</xsl:template>
</xsl:stylesheet>
You have to use xsl version 2.0 tho for this.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.