characters between two characters
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 49
- Joined: Mon Mar 28, 2016 3:54 pm
characters between two characters
Post by Raga Mounika »
Hi Team,
I want to write a schematron rule for document number in XSLT 1.0.For that I want to get the characters between two hyphen's (-) and also I want the characters after second hyphen.
Example:1313-231-546
I need to write the code for 231( placed in between two hyphens).
I need to write code for 546(after second hyphen)
Please help me out in solving this issue.
Thanks!
Regards,
Mounika
I want to write a schematron rule for document number in XSLT 1.0.For that I want to get the characters between two hyphen's (-) and also I want the characters after second hyphen.
Example:1313-231-546
I need to write the code for 231( placed in between two hyphens).
I need to write code for 546(after second hyphen)
Please help me out in solving this issue.
Thanks!
Regards,
Mounika
-
- Posts: 388
- Joined: Thu Jul 01, 2004 12:29 pm
Re: characters between two characters
Hello,
You can use the "substring-before()" and "substring-after()" functions to get the characters that you want, as in the following example:
The value of the "$no1" variable will be "231", and the value of the "$no2" variable will be "546".
I recommend you to address this type of questions on the Schematron mailing list or on the XSL mailing list, because are related to Schematron and XSL.
Best Regards,
Octavian
You can use the "substring-before()" and "substring-after()" functions to get the characters that you want, as in the following example:
Code: Select all
<xsl:variable name="var" select="'1313-231-546'"/>
<xsl:variable name="value" select="substring-after($var, '-')"/>
<xsl:variable name="no1" select="substring-before($value, '-')"/>
<xsl:variable name="no2" select="substring-after($value, '-')"/>
I recommend you to address this type of questions on the Schematron mailing list or on the XSL mailing list, because are related to Schematron and XSL.
Best Regards,
Octavian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “DITA (Editing and Publishing DITA Content)”
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