XSLT 1,0 and Arrays

Here should go questions about transforming XML with XSLT and FOP.
FJJCENT
Posts: 18
Joined: Sun Apr 22, 2018 10:17 pm

XSLT 1,0 and Arrays

Post by FJJCENT » Thu Jun 07, 2018 12:25 am

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

Radu
Posts: 6453
Joined: Fri Jul 09, 2004 5:18 pm

Re: XSLT 1,0 and Arrays

Post by Radu » Thu Jun 07, 2018 11:23 am

Hi,

Maybe you could post some sample XSLT code from your side, otherwise it's hard to tell...

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

adrian
Posts: 2548
Joined: Tue May 17, 2005 4:01 pm

Re: XSLT 1,0 and Arrays

Post by adrian » Thu Jun 07, 2018 11:52 am

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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

FJJCENT
Posts: 18
Joined: Sun Apr 22, 2018 10:17 pm

Re: XSLT 1,0 and Arrays

Post by FJJCENT » Thu Jun 07, 2018 12:00 pm

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

Post Reply