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

Parameter substitution

Subject: Parameter substitution
From: Curtis Burisch <burisch@xxxxxxxxxxx>
Date: Wed, 19 Dec 2001 17:31:34 +0000
curtis parameter
Hi,

I was going to start this message with something other than the 
ubiquitous "Hi I'm a newbie and I can't figure out how to do xyz can 
somebody PLEEZ help me" but alas I have failed in that, so let's cut to 
the chase:

Below is given a fragment from an XML document. Of note are the 
contents of the <ErrorText> nodes; the first one has a value of "%1 %2 
is not a valid date format.".

My task, (you guessed it) is to replace each %1, %2 etc.. with a string 
built from the correspondong ErrorParameter (formatted nicely of course)
. Being relatively new to XSLT, I can't think of a way to accomplish 
this in a generic manner. Has anyone got any ideas? I can't think of an 
approach that will actually work!

Thanks,
Curtis.

<InvalidBody>
<SynchError>
<ErrorId>1</ErrorId>
<ErrorKey>S12006</ErrorKey>
<ErrorText>%1 %2 is not a valid date format.</ErrorText>
<ErrorParameter>
<ErrorParameterType>X</ErrorParameterType>
<ErrorParameterValue>Some/XPATH/To/The/Offending/Value/Goes/In/Here</
ErrorParameterValue>
</ErrorParameter>
<ErrorParameter>
<ErrorParameterType>value</ErrorParameterType>
<ErrorParameterValue>2001212109</ErrorParameterValue>
</ErrorParameter>
</SynchError>
<SynchError>
<ErrorId>1</ErrorId>
<ErrorKey>S12006</ErrorKey>
<ErrorText>Dummy error message</ErrorText>
<ErrorURL>http://www.cnn.com</ErrorURL>
</SynchError>
<OriginalMessage>&lt;Original XML message as sent in.&gt;</
OriginalMessage>
</InvalidBody>

-- 

 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.