[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: XML -> XML and generate position in attribute prob

Subject: RE: XML -> XML and generate position in attribute problem
From: m.vanrootseler@xxxxxxxxx
Date: Fri, 15 Jun 2001 18:08:54 +0200
macros in word xml
Thanks Mike, but what page is that in the 1st edition (the one I have here)?

Mick

-----Oorspronkelijk bericht-----
Van: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]Namens Michael Kay
Verzonden: vrijdag 15 juni 2001 18:07
Aan: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Onderwerp: RE:  XML -> XML and generate position in attribute
problem


You'll find a stylesheet that does something very close to this in my XSLT
Programmers Refererence, 2nd edition, page 185. It doesn't generate the
position numbers, but that's the easy part.

Mike Kay
Software AG

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of
> m.vanrootseler@xxxxxxxxx
> Sent: 15 June 2001 16:51
> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  XML -> XML and generate position in attribute problem
>
>
> I?ve got the following prob that?s kept me busy all week. I
> want to convert
> one XML file into another in order to save me from having to
> write difficult
> macros in Word. The original XML looks something like this:
>
> <root>
> 	<line lineID="1">Hello there. World</line>
> 	<line lineID="2">one two, testing</line>
> etc. etc. etc.
> </root>
>
> What I want to do is wrap a <word>-tag around all words
> within <line>-tags,
> plus automatically generate something like 'wordID="x"' as
> well. The output
> of the sample above should look like this (underscores are
> spaces in this
> example):
>
> <root>
> 	<line lineID="1">
> 		<word wordID="1">Hello</word>_<word
> wordID="2">there</word>._<word
> wordID="3">World</word>
> 	</line>
> 	<line lineID="2">
> 		<word wordID="1">one</word>_<word
> wordID="2">two</word>,_<word
> wordID="3">testing</word>
> 	</line>
> </root>
>
> I know I can use <copy> to copy the original tags (with their
> attributes?)
> and probably use position() to work out the wordID (or am I
> wrong here?) but
> I simply can?t figure out how to do this. Plus I also have to
> look out for
> full stops and commas and exclude them from getting into the
> <word>-tags.
> Has anyone got any clues, ideas, tips (or totally-ready-made
> code) for me?
> Much appreciated.
>
> Mick
> m.vanrootseler@xxxxxxxxx
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.