stripping a text string to one character
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 1
- Joined: Thu Sep 14, 2006 10:55 pm
stripping a text string to one character
Post by greenday45 »
hello...I am a complete noob to xslt and I need to know how to take a string of text and output it so only the first character is output. I've looked all over the web but I must not be searching for the right thing...Please help!!!!
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post by sorin_ristache »
Hello,
For example if you want to output the first character of the string value of the element elem you can use substring(elem, 1, 1) in an XPath expression (the select, test, etc. attributes). If you have a variable var that binds to the string you must use substring($var, 1, 1). Without knowing more about your input and output I cannot give you more help.
Regards,
Sorin
For example if you want to output the first character of the string value of the element elem you can use substring(elem, 1, 1) in an XPath expression (the select, test, etc. attributes). If you have a variable var that binds to the string you must use substring($var, 1, 1). Without knowing more about your input and output I cannot give you more help.
Regards,
Sorin
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service