Subject: [xsl] Parameter substitution From: Curtis Burisch <burisch@xxxxxxxxxxx> Date: Wed, 19 Dec 2001 17:31:34 +0000 |
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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] DOM and XPath slows down , Khurram Chaudhry | Thread | Re: [xsl] Parameter substitution, Jeni Tennison |
Re: [xsl] document() merge DISTINCT, Alex Schuetz | Date | Re: [xsl] One nodeset, multiple bra, Jeni Tennison |
Month |