Page 1 of 1

XSLT 1,0 and Arrays

Posted: Thu Jun 07, 2018 12:25 am
by FJJCENT
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

Re: XSLT 1,0 and Arrays

Posted: Thu Jun 07, 2018 11:23 am
by Radu
Hi,

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

Regards,
Radu

Re: XSLT 1,0 and Arrays

Posted: Thu Jun 07, 2018 11:52 am
by adrian
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

Re: XSLT 1,0 and Arrays

Posted: Thu Jun 07, 2018 12:00 pm
by FJJCENT
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