How to use InDesign and XML?

Cergorach

The Laughing One
Has anyone any experience with XML in InDesign?

I understand the XML basics, i know InDesign pretty well, but have never used the two together, i would like to.

What i want to accomplish for example is to use the SRD spell lists in XML (i got an example made by someone else) to generate pages and pages of spells, already laid out.

Example spell in XML:
PHP:
<spell name="Acid Arrow">
<school>Conjuration</school>
<sub-school>Creation</sub-school>
<descriptor>Acid</descriptor>
<level class="Sor" class_lvl="2"/>
<level class="Wiz" class_lvl="2"/>
<component value="V"/>
<component value="S"/>
<component value="M"/>
<component value="F"/>
<casting-time>1 standard action</casting-time>
<range>Long (400 ft. + 40 ft./level)</range>
<target-area-effect>One arrow of acid</target-area-effect>
<duration>1 round + 1 round per three levels</duration>
<saving-throw>None</saving-throw>
<spell-resistance>No</spell-resistance>
<long-description><p>A magical arrow of acid springs from your hand and speeds to its target. You must succeed on a ranged touch attack to hit your target. The arrow deals 2d4 points of acid damage with no splash damage. For every three caster levels (to a maximum of 18th), the acid, unless somehow neutralized, lasts for another round, dealing another 2d4 points of damage in that round.</p>
<p>Material Component: Powdered rhubarb leaf and an adder's stomach.</p>
<p>Focus: A dart.</p>
</long-description>
</spell>
note: the code tag doesn't display the XML tags, strangely the PHP tag does, sorry for the nasty colors...

I can neatly import the XML and i get a neat structure overview, when i drag an XML spell to the document it looks like this:

Conjuration
Creation
Acid






1 standard action
Long (400 ft. + 40 ft./level)
One arrow of acid
1 round + 1 round per three levels
None
No
A magical arrow of acid springs from your hand and speeds to its target. You must succeed on a ranged touch attack to hit your target. The arrow deals 2d4 points of acid damage with no splash damage. For every three caster levels (to a maximum of 18th), the acid, unless somehow neutralized, lasts for another round, dealing another 2d4 points of damage in that round.
Material Component: Powdered rhubarb leaf and an adder’s stomach.
Focus: A dart.

How do i display the attributes like the spell name and spell level? I would like to add Range: before the range component. I would like to automatically generate pages and pages of spell lists by dragging them to the document with the attributes and text that describes the components (such as range).

I don't know if i can do this with standard InDesign functionality or that i need to write a script for it. I'll be messing around with this little 'problem', but it would be really helpful if someone who has any experience with this to give some pointers...
 
Last edited:

log in or register to remove this ad

My guess is the document definitions file has errors or the XML data files have errors. I'd also check and make sure that both InDesign and the XML files are both for the same version of XML. For all you know, the XML could be for version x.03, and InDesign only handles the standards set for version x.01 or some other problem of that nature.
 

Dana_Jorgensen said:
My guess is the document definitions file has errors or the XML data files have errors. I'd also check and make sure that both InDesign and the XML files are both for the same version of XML. For all you know, the XML could be for version x.03, and InDesign only handles the standards set for version x.01 or some other problem of that nature.

The XML file is fine, no errors in InDesign (i'm using IDCS). The document definitions file isn't neccesary, ID indexes all the tags (even all the attributes) and you can link styles to these tags.

My 'problem' is that i want every thing automated, i probably have to use some scripting...
 

Remove ads

Top