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

String parsing, node creation

Subject: String parsing, node creation
From: Michael Clark <MClark@xxxxxxxxxxxxxx>
Date: Tue, 26 Feb 2002 14:01:22 -0700
xml node creation
Hello, and thanks in advance for reading my question!

I'll jump right into the code, since it explains itself better than I can.

<!-- My source XML -->
<doc>
	<txt>
		This will be a fairly large block of text.
		Text block text block text block text block.
		It will go on for a while ... then stop.
	</txt>
</doc>

The problem I have now, is as follows: My <txt> nodes may only have #text
nodes of a certain, very short length (say, 38 characters).

So, after proper translation my xml document should look as follows:

<doc>
	<txt>This will be a 256 char block of text.</txt>
	<txt> Text block text block text block text</txt>
	<txt> block.  It will go on for a while ...</txt>
	<txt>then stop.</txt>
</doc>

The real hitch is the #text must be broken up by word blocks (words
tokenized by space (' '), not purely by character length.

I am using Xalan, so I thought I might do this rather tedious bit
of parsing directly on the DOM tree in Java -- but I would
really prefer to have all my conversion contained within my XSL.

Sorry that I don't have an XSL base to start from, I have no idea where to
start.

There seem to be some very bright and XSL fluent minds on this list, I am
constantly amazed at the complexity of the XSLT that goes on here on the
list!
Thanks

Michael
Research and Development
SandCherry, Inc.
mclark@xxxxxxxxxxxxxx


 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.