[thelist] XML developer question

jon at daemon.com.au jon at daemon.com.au
Mon Oct 7 04:01:01 CDT 2002


> <facet id="12">
>   <title>Things to do</title>
>   <description>Activities, events, etc</description> <topic id="camping">
>     <name>Camping</name>
>     <topic id="rough">
>       <name>roughing it</name>
>     </topic>
>     <topic id="wimpy">
>       <name>Comfort Plus</name>
>     </topic>
>   </topic>
>   <topic id="sightseeing">
>     <name>Sight Seeing</name>
>   </topic>
>   <topic id="eating">
>     <name>eating</name>
>   <topic>
> </facet>
>
> Or alternatively:
>
> <facet id="12">
>   <title>Things to do</title>
> <description>Activities, events, etc</description> </facet>
>
>   <topic id="camping" facetid="12">
>     <name>Camping</name>
>   <topic>
>     <topic id="rough" facetid="12" parentTopicid="camping">
>       <name>roughing it</name>
>     </topic>
>     <topic id="very_rough" facetid="12" parentTopicid="rough">
>       <name>very rough camping</name>
>     </topic>
> [and so on ...]


Im not sure whay you're asking this, most of languages have an XML parser
that will handle all the horrible stuff for developers.

If someone had to develop it by hand, then you would make it easiest on
them to only use <tags/>, and not use attributes.

Hence you would get something like this:

<facet>
	<id>12</id>
	<title>Things to do</title>
	<description>Activities, events, etc</description>
</facet>
<topic>
	<id>camping</id>
	<facetid>12</facetid>

... etc etc

Its a bit bulkier than using attributes, but it makes the parser writers
job a lot easier.

Jon.



More information about the thelist mailing list