OfficeTime |
Newbie |
|
Switzerland |
|
|
None Specified |
|
Tuesday, September 2, 2014 |
Tuesday, September 2, 2014 11:17:30 AM |
1 [0.01% of all post / 0.00 posts per day] |
|
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?
|
|