Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: Removing Tabs from source XML in output from XSLT [Thread Next] Re: Removing Tabs from source XML in output from XSLTTo: NULL Date: 8/2/2006 12:48:00 AM You cannot replace strings, only characters. The replacement is a string, for instance if you want to write an entity reference for a specific character then you can map that character to the string that represents an entity reference to that character. Best Regards, George --------------------------------------------------------------------- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger www.---.com cmay wrote: > Thanks George, I didn't know about that option and it looks pretty > good, good thing to know. > > Is there anything similar that will allow for replacement of strings in > this manner? > > I see that then 2nd parameter can be a string, but everything I have > read indicates that the first parameter "character" must be a single > character and can't be a string. > > I'm guessing there isn't anything to do this other than writing your > own function correct? > > > Chris > > > > George Bina wrote: > > If you can use XSLT 2.0 then you can use a character map. Just add the > > following lines to your stylesheet and the tabs will be removed from > > output: > > > > <xsl:character-map name="test"> > > <xsl:output-character character="	" string=""/> > > </xsl:character-map> > > <xsl:output use-character-maps="test"/> > > > > Best Regards, > > George > > --------------------------------------------------------------------- > > George Cristian Bina > > <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger > > www.---.com > > > > cmay wrote: > > > I am having this problem... > > > Lets say that your source XML is formatted like this: > > > <somenode> > > > Here is some text > > > Here is some more text > > > </somenode> > > > > > > When to a <xsl:value-of select="somenode" /> I want the output to be > > > free of the tabs that are included in the source XML. > > > These tabs are not really part of the content, but rather just there > > > for formatting reasons. > > > > > > I tried doing: > > > <xsl:value-of select='translate(somenode,"	", "")'/> > > > But that didn't seem to have an effect. > > > > > > > > > Any way to do this? | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
