Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple XML Help 1

Status
Not open for further replies.

dougnotdoug

Technical User
Joined
May 18, 2004
Messages
2
Location
US
I am completely devoid of XML knowledge. I am trying to use an automated feature of Adobe Illustrator that uses an XML file to replace a variable in a document. (The XML file needs to contain a list of values that will be filled in and saved as seperate documents.) I have the XML file that contains 1 data set for the variable. My question is, how do I modify the XML to include 150 more datasets that will be placed into the variable field? In this case my dataset is a list of simple text strings. Here is the XML I need to modify:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20001102//EN" " [
<!ENTITY ns_graphs " <!ENTITY ns_vars " <!ENTITY ns_imrep " <!ENTITY ns_custom " <!ENTITY ns_flows "<!ENTITY ns_extend "]>
<svg>
<variableSets xmlns="&ns_vars;">
<variableSet varSetName="binding1" locked="none">
<variables>
<variable varName="Variable1" trait="textcontent" category="&ns_flows;"></variable>
</variables>
<v:sampleDataSets xmlns="&ns_custom;" xmlns:v="&ns_vars;">
<v:sampleDataSet dataSetName="Data Set 1">
<Variable1>
<p>$8.99</p>
</Variable1>
</v:sampleDataSet>
</v:sampleDataSets>
</variableSet>
</variableSets>

</svg>

The "$8.99" is the one existing dataset and I need to add 150 more text strings. How do I properly do this? Any help is appreciated.

Thank you
 
This is just pure guesswork, but from looking at your file, you need two elements per variable.

One element inside the "variables" node, and one inside the sampleDataSet node. Seems odd, but try this as an attempt to "extend" your XML file by adding one more variable.

Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20001102//EN"    "[URL unfurl="true"]http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd"[/URL] [
    <!ENTITY ns_graphs "[URL unfurl="true"]http://ns.adobe.com/Graphs/1.0/">[/URL]
    <!ENTITY ns_vars "[URL unfurl="true"]http://ns.adobe.com/Variables/1.0/">[/URL]
    <!ENTITY ns_imrep "[URL unfurl="true"]http://ns.adobe.com/ImageReplacement/1.0/">[/URL]
    <!ENTITY ns_custom "[URL unfurl="true"]http://ns.adobe.com/GenericCustomNamespace/1.0/">[/URL]
    <!ENTITY ns_flows "[URL unfurl="true"]http://ns.adobe.com/Flows/1.0/">[/URL]
<!ENTITY ns_extend "[URL unfurl="true"]http://ns.adobe.com/Extensibility/1.0/">[/URL]
]>
<svg>
<variableSets  xmlns="&ns_vars;">
    <variableSet  varSetName="binding1" locked="none">
        <variables>
            <variable  varName="Variable1" trait="textcontent" category="&ns_flows;"></variable>
            <variable  varName="Variable2" trait="textcontent" category="&ns_flows;"></variable>
        </variables>
        <v:sampleDataSets  xmlns="&ns_custom;" xmlns:v="&ns_vars;">
            <v:sampleDataSet  dataSetName="Data Set 1">
                <Variable1>
                    <p>$8.99</p>
                </Variable1>
                <Variable2>
                    <p>$18.99</p>
                </Variable2>
            </v:sampleDataSet>
        </v:sampleDataSets>
    </variableSet>
</variableSets>

</svg>

...and so on.

Thomas D. Greer
Providing PostScript & PDF
Training, Development & Consulting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top