IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

document(), XSLT 2.0 Options · View
OfficeTime
Posted: Tuesday, September 2, 2014 11:17:30 AM
Rank: Newbie

Joined: 9/2/2014
Posts: 1
Location: Switzerland
I've got a file called Dictionary.xml

Code:

<?xml version="1.0" encoding="UTF-8"?>
<DICTIONARY SNAPSHOT_DATE="30.07.2014 17:55:37" SNAPSHOT_CREATOR="XYZ" MODULE="Core" MODULE_VERSION_FROM="ALL" MODULE_VERSION_UNTIL="1.04">
  <DICT_ENTRY DICT_ID="58384" VARIANT_ID="13692" STATUS="NEW">
    <LANG_ENTRY LANG_ID="EN" STATUS="PROOFED"><![CDATA[Reset target]]></LANG_ENTRY>
  </DICT_ENTRY>
... snip...
</DICTIONARY>


I try to use it in my XSLT

Code:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fn="w3.org/2005/xpath-functions" xmlns:xs="w3.org/2001/XMLSchema" exclude-result-prefixes="xs fn">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

<xsl:param name="dictionary_file">Dictionary.xml</xsl:param>
<xsl:variable name="dictstrings" select="document($dictionary_file)"/>
... snip...
</xsl:stylesheet>


This generates an error (in Altova XMLSpy Professional Edition v2012 sp1) saying

Code:

XTDE1170: Error in XPath 2.0 expression
Error retrieving resource 'Dictionary.xml'


BUT, if I simplify the content of Dictionary.xml, so that it reads

Code:

<?xml version="1.0" encoding="UTF-8"?>
<DICTIONARY>
    <DICT_ENTRY DICT_ID="58384">
        <LANG_ENTRY>Reset target</LANG_ENTRY>
    </DICT_ENTRY>
... snip ...
</DICTIONARY>


Then it loads and uses the content of Dictionary.xml.

I assume there is something about the format of the original Dictionary.xml that it doesn't like.
Do you know what? Or is there some other problem that I haven't identified here?

Do you have a good suggestion as to how I can make some XSLT so that my users can run an XSLT stylesheet, using an unaltered dictionary file in the original format?
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.