我在我的项目中有以下XML sturture。我需要写的财产以后该调换重复的节点,使扁平stutureXML flaten重复节点
<bookstore>
<book >
<title lang="en">Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
</book>
<book >
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
<book>
<title lang="en">Learning XML</title>
<author>Erik T. Ray</author>
<year>2003</year>
<price>39.95</price>
</book>
</bookstore>
我想flaten的sturture这样
<bookstore>
<bookonetitle lang="en">Everyday Italian</bookonetitle>
<bookoneauthor>Giada De Laurentiis</bookoneauthor>
<bookoneyear>2005</bookoneyear>
<bookoneprice>30.00</bookoneprice>
<booktwotitle lang="en">Harry Potter</booktwotitle>
<booktwoauthor>J K. Rowling</booktwoauthor>
<booktwoyear>2005</booktwoyear>
<booktwoprice>29.99</booktwoprice>
<bookthreetitle lang="en">Learning XML</bookthreetitle>
<bookthreetitle>Erik T. Ray</bookthreetitle>
<bookthreetitle>2003</bookthreetitle>
<bookthreetitle>39.95</bookthreetitle>
</bookstore>
它仅限于3?或者可以有任何号码?很难将数字转换为英文拼写的数字。也许像书名一样的元素名称就足够了? –
XSLT 1.0?或2.0? –
我很好奇你为什么要将数据放入元素名称中,而不是仅仅具有附加属性的书籍平面结构。重组的目标是什么? –