|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Parameter substitution
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><Original XML message as sent in.></ OriginalMessage> </InvalidBody> -- XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|

Cart








