Re: [xsl] Weird problem with doc()

Subject: Re: [xsl] Weird problem with doc()
From: "Mark Giffin m1879@xxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 30 May 2022 06:11:12 -0000
Thanks Graydon,


The external file looks like this, some ishfields have content, some don't.
FTITLE does have a string value.



B 
B B B  Mini test pub
B B B 
B B B 
B B B  1
etc.

This code works fine outside of the DITA OT. I tried xsl:sequence instead of
xsl:value-of and it has the same weird behavior, it can access the file but
XPath has no effect.
B 
By the way my markup did not come through, the code was xsl:message elements
in my original post below.

Mark
B 
B 
-----Original Message-----
From:
Sent: May 29, 2022 8:19 PM
To:
Subject: Re: [xsl] Weird problem with doc()
B 
On Mon, May 30, 2022 at 03:01:11AM -0000, Mark Giffin
m1879@xxxxxxxxxxxxx scripsit:
> Using XSLT 2.0, I'm using doc() to access data in an outside XML file.
> This is running inside the DITA Open Toolkit, which is an Apache Ant
> application. doc() accesses the whole file and displays the text
> content of elements when I do this:
>
> OUTSIDE FILE - select="doc('file:/C:/Users/mark/test
> /publicationoutput.xml')"/>
B 
> This is expected. But when I add some XPath to get to certain data inside
the
> file like below, the output goes blank:
>
> OUTSIDE FILE - /publicationoutput.xml')//ishfield[@name = 'FTITLE']"/>
>
> The XPath is correct because I can run this exact code outside of the DITA
Open
> Toolkit and it works as expected. I realize there is a lot going on inside
the
> DITA OT but I'm just curious what kind of thing could cause this strange
> behavior of doc() being able to access the file, but failing with XPath.
There
> is no error reported.
B 
You should be getting a text node with content formed from the string
values of the ishfield elements making up the sequence of ishfield
elements where the name attribute value is FTITLE separated by spaces.
B 
Are you sure the ishfield elements have string values? (that is,
descendent text nodes?)
B 
What happens when you replace value-of with sequence?
B 
--
Graydon Saunders | graydonish@xxxxxxxxx
CC&s oferC)ode, C0isses swC! mC&g.
-- Deor ("That passed, so may this.")

B 

B 

Current Thread