trouble with variables value not available
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 4
- Joined: Wed Nov 25, 2015 5:45 pm
trouble with variables value not available
Hello,
Assuming that :
Can someone explain me why this is retrieving some data :
and this is not ( i get the message "The variable value is unavailable') :
I am working with oxygen 16.1 and saxon 9.5 HE. Any help would be much appreciated. I am really annoyed because when i put my xpath in xwatch, the second option works... :$ tried a lot of things and i can't get it to work with my variable...
Assuming that :
Code: Select all
<xsl:variable name="eur-uri" select="resolve-uri('prices/eur.xml',base-uri())"/>
<xsl:variable name="eur-node" select="document($eur-uri)" />
Code: Select all
<xsl:value-of select="$eur-node//node()[text() = '4.99']/@position" />
Code: Select all
<xsl:variable name="prix-fr" as="xs:string" ><xsl:text>4.99</xsl:text></xsl:variable>
<xsl:value-of select="$eur-node//node()[text() = $prix-fr]/@position" />
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: trouble with variables value not available
Hi,
I created a small XML and XSLT to reproduce your situation.
The XML looks like this:
and the XSLT looks like this:
On my side the transformation works and produces the proper result, it outputs the "abc" position on the element.
So please give me more details about your problem, maybe some screenshots... Does the publishing fail to produce the desired output or does the XSLT debugger sometimes present the wrong value for certain variables?
Officially we no longer give tech support advice or make fixes for for Oxygen 16:
https://www.oxygenxml.com/eol.html#eol_tables
so maybe at some point you could consider upgrading.
Regards,
Radu
I created a small XML and XSLT to reproduce your situation.
The XML looks like this:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<root>
<a position="abc">4.99</a>
</root>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs"
version="2.0">
<xsl:template match="/">
<root>
<xsl:variable name="eur-uri" select="resolve-uri('eur.xml',base-uri())"/>
<xsl:variable name="eur-node" select="document($eur-uri)" />
<xsl:variable name="prix-fr" as="xs:string" ><xsl:text>4.99</xsl:text></xsl:variable>
<xsl:value-of select="$eur-node//node()[text() = $prix-fr]/@position" />
</root>
</xsl:template>
</xsl:stylesheet>
So please give me more details about your problem, maybe some screenshots... Does the publishing fail to produce the desired output or does the XSLT debugger sometimes present the wrong value for certain variables?
Officially we no longer give tech support advice or make fixes for for Oxygen 16:
https://www.oxygenxml.com/eol.html#eol_tables
so maybe at some point you could consider upgrading.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 4
- Joined: Wed Nov 25, 2015 5:45 pm
Re: trouble with variables value not available
Hello Radu,
Thank you so much for the answer.
I have not thought that the debugger could be wrong and did not check the publishing result.
I'll investigate further in this direction and come back to you.
Regards.
Thank you so much for the answer.
I have not thought that the debugger could be wrong and did not check the publishing result.
I'll investigate further in this direction and come back to you.
Regards.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: trouble with variables value not available
Hi,
Usually the debugger reports things like The variable value is unavailable because the Saxon 9 XSLT processor may choose to postpone evaluating a variable, for example it may not evaluate the variable at all if it is not used at all or it may evaluate the variable only when it reaches the place where it's used.
Regards,
Radu
Usually the debugger reports things like The variable value is unavailable because the Saxon 9 XSLT processor may choose to postpone evaluating a variable, for example it may not evaluate the variable at all if it is not used at all or it may evaluate the variable only when it reaches the place where it's used.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
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