- Jun
- 137
- 3
I'm really weak at XML. OK, given that, I'm trying to write a simple script that will read an XML-formatted file and produce a value out of it. Here is a subset of the sample XML file:
Here is my ill-fated attempt at reading the SchemaVersion value (for which I want the end result of this batch file to set the _InstallShieldSchema variable to 774):
When I run this, I get an error: "TCMD: (XML) Line: 3; Char: 11 DTD is prohibited."
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="is.xsl" ?>
<!DOCTYPE msi [
<!ELEMENT msi (summary,table*)>
<!ATTLIST msi version CDATA #REQUIRED>
]>
<msi version="2.0" xmlns:dt="urn:schemas-microsoft-com:datatypes" codepage="65001">
<summary>
<codepage>1252</codepage>
<title>Installation Database</title>
</summary>
<table name="InstallShield">
<col key="yes" def="s72">Property</col>
<col def="S0">Value</col>
<row><td>ActiveLanguage</td><td>1033</td></row>
<row><td>SchemaVersion</td><td>774</td></row>
<row><td>Type</td><td>MSI</td></row>
</table>
</msi>
Here is my ill-fated attempt at reading the SchemaVersion value (for which I want the end result of this batch file to set the _InstallShieldSchema variable to 774):
Code:
set _InstallShieldSchema=%@XMLXPath["Aurora.ism","//msi/table[@name='InstallShield']/SchemaVersion"]
echo SchemaVersion is %_InstallShieldSchema
When I run this, I get an error: "TCMD: (XML) Line: 3; Char: 11 DTD is prohibited."