Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Removing Tabs from source XML in output from XSLT

From: "George Bina" <george@---------.--->
To: 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="&#9;" 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,"&#x9", "")'/>
> > > But that didn't seem to have an effect.
> > > 
> > > 
> > > Any way to do this?



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent