[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Nodes have the same level
You might be lucky, someone might look at this problem and decide to tackle it for you. But I'd be surprised. The source document is long, and its structure is unclear because of the lack of indentation. It's also incomplete, so people can't play with it directly using their favourite tools. It requires a lot of analysis to work out how your desired output relates to the input. And you haven't given enough information about your own efforts for us to know where your difficulties lie. For example, your problems might be all to do with namespaces, but we can't tell without seeing your non-working code. Try to produce a very simplified version of the problem. See if you can solve that. If you can't, ask again, giving a complete source document, the desired result, and your attempt to solve it. Ideally try to get the source and result down to about 10 lines each. Michael Kay http://www.saxonica.com/ > -----Original Message----- > From: aaron apigo [mailto:aaronjose_apigo2001@xxxxxxxxx] > Sent: 31 August 2005 07:45 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: Nodes have the same level > > Hi, > I have this XML input > > <text:p text:style-name="P41"> > <text:bookmark-start text:name="bib1"/> > <text:span text:style-name="T4"> > <text:user-field-get text:name="ce:bib-reference">ITEM > ID : > </text:user-field-get> > </text:span> > <text:span text:style-name="T4"> > <text:user-field-get > text:name="[1]">[1]</text:user-field-get> > </text:span> > </text:p> > <text:p text:style-name="P42"> > <text:user-field-get > text:name="sb:reference">BB</text:user-field-get> > </text:p> > <text:p text:style-name="P43"> > <text:user-field-get > text:name="sb:contribution">CONTRIBUTION > </text:user-field-get> > </text:p> > <text:p text:style-name="P40"> > <text:user-field-get text:name="sb:author">Author > :</text:user-field-get> > <text:span text:style-name="T1"> > <text:user-field-get text:name="ce:given-name">fnm > </text:user-field-get> > </text:span> > <text:span text:style-name="T1">R.F.</text:span> > <text:span text:style-name="T1"> > <text:user-field-get text:name="ce:surname">snm > </text:user-field-get> > </text:span> > <text:span text:style-name="T1">Ziolo</text:span> > </text:p> > <text:p text:style-name="P40"> > <text:user-field-get text:name="sb:author">Author > :</text:user-field-get> > <text:span text:style-name="T1"> > <text:user-field-get text:name="ce:given-name"> > fnm</text:user-field-get> > </text:span> > <text:span text:style-name="T1">E.P.</text:span> > <text:span text:style-name="T1"> > <text:user-field-get text:name="ce:surname"> > snm</text:user-field-get> > </text:span> > <text:span text:style-name="T1">Giannelis</text:span> > </text:p> > <text:p text:style-name="P43"> > <text:user-field-get > text:name="sb:issue">ISSUE</text:user-field-get> > </text:p> > <text:p text:style-name="P43"> > <text:user-field-get > text:name="sb:series">SERIES</text:user-field-get> > </text:p> > <text:p text:style-name="P40"> > <text:user-field-get text:name="sb:title">Title > :</text:user-field-get> > Science</text:p> > <text:p text:style-name="P40"> > <text:user-field-get text:name="sb:volume-nr">Vol nr > :</text:user-field-get>257</text:p> > <text:p text:style-name="P40"> > <text:user-field-get text:name="sb:date">Date > :</text:user-field-get>1992</text:p> > <text:p text:style-name="P43"> > <text:user-field-get text:name="sb:pages">Pages > :</text:user-field-get> > </text:p> > <text:p text:style-name="P40"> > <text:user-field-get > text:name="sb:first-page">First-Page > :</text:user-field-get>219 > <text:bookmark-end text:name="bib1"/> > </text:p> > <text:p text:style-name="P41"/> > <text:p text:style-name="P41"> > <text:bookmark-start text:name="bib2"/> > <text:span text:style-name="T4"> > <text:user-field-get text:name="ce:bib-reference">ITEM > ID > :</text:user-field-get> > </text:span> > <text:span text:style-name="T4"> > <text:user-field-get > text:name="[2]">[2]</text:user-field-get> > </text:span> > </text:p> > <text:p text:style-name="P42"> > <text:user-field-get > text:name="sb:reference">BB</text:user-field-get> > </text:p> > <text:p text:style-name="P43"> > <text:user-field-get text:name="sb:contribution"> > CONTRIBUTION</text:user-field-get> > </text:p> > <text:p text:style-name="P40"> > <text:user-field-get text:name="sb:author">Author > :</text:user-field-get> > <text:span text:style-name="T1"> > <text:user-field-get text:name="ce:given-name"> > fnm</text:user-field-get> > </text:span> > <text:span text:style-name="T1">D.</text:span> > <text:span text:style-name="T1"> > <text:user-field-get text:name="ce:surname"> > snm</text:user-field-get> > </text:span> > <text:span text:style-name="T1">Wirtz</text:span> > </text:p> > <text:p text:style-name="P40"> > <text:user-field-get text:name="sb:author">Author > :</text:user-field-get> > <text:span text:style-name="T1"> > <text:user-field-get text:name="ce:given-name"> > fnm</text:user-field-get> > </text:span> > <text:span text:style-name="T1">M.</text:span> > <text:span text:style-name="T1"> > <text:user-field-get text:name="ce:surname"> > snm</text:user-field-get> > </text:span> > <text:span text:style-name="T1">Fermigier</text:span> > </text:p> > <text:p text:style-name="P43"> > <text:user-field-get > text:name="sb:issue">ISSUE</text:user-field-get> > </text:p> > <text:p text:style-name="P43"> > <text:user-field-get > text:name="sb:series">SERIES</text:user-field-get> > </text:p> > <text:p text:style-name="P40"> > <text:user-field-get text:name="sb:title">Title > :</text:user-field-get> > Phys. Rev. Lett</text:p> > <text:p text:style-name="P40"> > <text:user-field-get text:name="sb:volume-nr">Vol nr > :</text:user-field-get>72</text:p> > <text:p text:style-name="P40"> > <text:user-field-get text:name="sb:date">Date > :</text:user-field-get>1994</text:p> > <text:p text:style-name="P43"> > <text:user-field-get text:name="sb:pages">Pages > :</text:user-field-get> > </text:p> > <text:p text:style-name="P40"> > <text:user-field-get > text:name="sb:first-page">First-Page > :</text:user-field-get>2294<text:bookmark-end > text:name="bib2"/> > </text:p> > > and I want it to transform like this > > <ce:bib-reference id="bib1"> > <ce:label>[1]</ce:label> > <sb:reference> > <sb:contribution> > <sb:authors> > <sb:author> > <ce:given-name>R.F.</ce:given-name> > <ce:surname>Ziolo</ce:surname> > </sb:author> > <sb:author> > <ce:given-name>E.P.</ce:given-name> > <ce:surname>Giannelis</ce:surname></sb:author> > </sb:authors> > </sb:contribution> > <sb:host> > <sb:issue> > <sb:series> > > <sb:title><sb:maintitle>Science</sb:maintitle></sb:title> > > <sb:volume-nr>257</sb:volume-nr> > </sb:series> > <sb:date>1992</sb:date> > </sb:issue> > <sb:pages> > <sb:first-page>219</sb:first-page></sb:pages> > </sb:host> > </sb:reference> > </ce:bib-reference> > > <ce:bib-reference id="bib2"> > <ce:label>[2]</ce:label> > <sb:reference> > <sb:contribution> > <sb:authors> > <sb:author> > <ce:given-name>D.</ce:given-name> > <ce:surname>Wirtz</ce:surname> > </sb:author> > <sb:author> > <ce:given-name>M.</ce:given-name> > <ce:surname>Fermigier</ce:surname> > </sb:author> > </sb:authors> > </sb:contribution> > <sb:host> > <sb:issue> > <sb:series> > <sb:title><sb:maintitle>Phys. Rev. > Lett</sb:maintitle></sb:title> > <sb:volume-nr>72</sb:volume-nr> > </sb:series> > <sb:date>1994</sb:date> > </sb:issue> > <sb:pages> > <sb:first-page>2294</sb:first-page></sb:pages> > </sb:host> > </sb:reference> > </ce:bib-reference> > > Could this possible? > > It's very difficult for me to transform this XML > because the nodes have the same level (text:p), I > cannot used the <xsl:for-each> or maybe my stylesheet > was wrong. > Can somebody help me with this or any idea how can I > transform it? > > regards. > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|