XSLT 1,0 and Arrays
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 25
- Joined: Sun Apr 22, 2018 10:17 pm
XSLT 1,0 and Arrays
Hi EveryBody, I am working with XSLT 1.0 because it's the only release supported by Visual Studio and i'm having problems with the arrays, I explain in most detail,
I have the following string: http://www.enterprise.com/data/department/document.xml
and I need to access to document.xml and because the string has not always the same size and content I have created an SPLIT function (tokenize is not valid in XSLT 1.0) and taking the character '/' it creates an Array called myArray but the problem is that once created myArray it appears with dimension 0 and count(myArray) yields 1 so something as myArray[2] doesn't work, I try to obtain document.xml by myArray[count(myArray)] but also don't work.
Any suggestion
I have the following string: http://www.enterprise.com/data/department/document.xml
and I need to access to document.xml and because the string has not always the same size and content I have created an SPLIT function (tokenize is not valid in XSLT 1.0) and taking the character '/' it creates an Array called myArray but the problem is that once created myArray it appears with dimension 0 and count(myArray) yields 1 so something as myArray[2] doesn't work, I try to obtain document.xml by myArray[count(myArray)] but also don't work.
Any suggestion
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: XSLT 1,0 and Arrays
Hi,
Not sure what you're calling an array here. There are no arrays in XSLT/XPath, only sequences and node sets.
Also, it's not clear what your "array" is suppose to contain after processing your string.
Is it the full path? Like this:
myArray[0]=http://
myArray[1]=www.enterprise.com/
myArray[2]=data/
myArray[3]=department/
myArray[4]=document.xml
Like Radu said, show us what you got so far.
Regards,
Adrian
Not sure what you're calling an array here. There are no arrays in XSLT/XPath, only sequences and node sets.
Also, it's not clear what your "array" is suppose to contain after processing your string.
Is it the full path? Like this:
myArray[0]=http://
myArray[1]=www.enterprise.com/
myArray[2]=data/
myArray[3]=department/
myArray[4]=document.xml
Like Radu said, show us what you got so far.
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 25
- Joined: Sun Apr 22, 2018 10:17 pm
Re: XSLT 1,0 and Arrays
Hi Adrian, you are in reason I'm used to do an split and get the data in an array, but I see that here after getting the array in order to work with it you need to convert it in a node set, i've just done it with msxml:node-set() function and I get twelve nodes, I have just submited a new post explaining and showing the code.
Best Regards
Best Regards
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