Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: Output of copy-of into a variable? >Thread Next - Re: Output of copy-of into a variable? Re: Output of copy-of into a variable?To: NULL Date: 1/12/2009 2:16:00 AM On 9 Jan., 12:56, Martin Honnen <mahotr...@yahoo.de> wrote: > michael.skovfo...@gmail.com wrote: > > I want to transform nodes into a file with a maximum linewidth. > > Therefore I need to have the output result of copy-of into a variable > > and then use substring to output a specific number of characters on > > each line. I have tried: > > > =A0 =A0 =A0 =A0 =A0 =A0 <xsl:variable name=3D"VarName"> > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <xsl:copy-of select=3D"."/> > > =A0 =A0 =A0 =A0 =A0 =A0 </xsl:variable> > > =A0 =A0 =A0 =A0 =A0 =A0 <xsl:value-of select=3D"substring($VarName, 1, = 20)"/> > > =A0 =A0 =A0 =A0 =A0 =A0 <xsl:text>
</xsl:text> > > =A0 =A0 =A0 =A0 =A0 =A0 <xsl:value-of select=3D"substring($VarName, 21,= 40)"/> > > =A0 =A0 =A0 =A0 =A0 =A0 <xsl:text>
</xsl:text> > > > But this does not give the nodenames etc. and I can understand why as > > the variable contains the node. > > > Does anyone know how to do this? > > I don't understand what you want to achieve. substring operates on > string values, whether you pass in a variable or some other expression > does not matter. > > If you want to operate on the markup of nodes then you first need to > serialize a node, Saxon (an XSLT 2.0 processor) has an extension > function for that:http://www.saxonica.com/documentation/extensions/functi= ons/serialize.... > If you want to parse a string with XML markup back into nodes then you > can usehttp://www.saxonica.com/documentation/extensions/functions/parse.h= tml > > -- > > =A0 =A0 =A0 =A0 Martin Honnen --- MVP XML > =A0 =A0 =A0 =A0http://JavaScript.FAQTs.com/- Skjul tekst i anf=F8rselsteg= n - > > - Vis tekst i anf=F8rselstegn - Hi again, I want a node like this: <RmtInf><Ustrd>Invoices 123 and 321</Ustrd></RmtInf> to be output like this: SOMEINFO <RmtInf><Ustrd>Invoices 123 a OTHERINFO nd 321</Ustrd></RmtInf> I am using Visual Studio .Net to make the transformation. Best, Michael | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
