2008年8月26日星期二

STX Transform Notes

I tries to transform xml with Joost(STX), but I found that sometimes the child nodes cannot be matched and transformed.
Finally I found the problem was tied with the XML namespace, and made the transform working in this way, please notice the prefix "myns" both in root node and child nodes:

Source XML:

<RootNode xmlns="http://.... " >
<ChildNode>
....

STX:
<stx:transform version="1.0"
xmlns:stx="http://stx.sourceforge.net/2002/ns"
xmlns:myns="http://www.../" >

<stx:template match="myns:RootNode">
...
<stx:template>

<stx:template match="myns:ChildNode">
...
<stx:template>

没有评论: