想要为 XML 编写 XSLT 以获得树形结构吗?
我有一些像这样的XML;我想编写 XSLT。我可以在其中提取属性 V。并生成这样的树结构。
PS . . ....Product Category . . . . . . . Product. . ....Financial Product Images . . .Product2. Other . . ........Customer Location Images . . . Service3.
<PV V="PS:Product Category:Product1" L="" H="" C="327" />
<PV V="PS:Financial Product Images:Product2" L="" H="" C="173" />
<PV V="Other:Customer Location Images:Service2" L="" H="" C="122" />
<PV V="PS:POS Product Images:Product3" L="" H="" C="109" />
<PV V="N/A" L="" H="" C="106" />
<PV V="Other:Customer Location Images:Service 3" L="" H="" C="98" />
有人可以帮助我吗,我对 XSLT 很陌生
I have got some XML like this; I want to be writing a XSLT. Where I can extract the attribute V. And produce a Tree Structure like this.
PS . . ....Product Category . . . . . . . Product. . ....Financial Product Images . . .Product2. Other . . ........Customer Location Images . . . Service3.
<PV V="PS:Product Category:Product1" L="" H="" C="327" />
<PV V="PS:Financial Product Images:Product2" L="" H="" C="173" />
<PV V="Other:Customer Location Images:Service2" L="" H="" C="122" />
<PV V="PS:POS Product Images:Product3" L="" H="" C="109" />
<PV V="N/A" L="" H="" C="106" />
<PV V="Other:Customer Location Images:Service 3" L="" H="" C="98" />
Can anybody please help me i am very new to XSLT
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用此 XSLT
标记名称不能包含空格,因此您需要将其替换为其他字符。这是通过将空格替换为“_”来完成的。
You could use this XSLT
A tag name cannot have whitespaces so you need to replace them by some other character. This is done here by replacing spaces by '_'.