Hi everyone
I’v read pretty much about XML, but all i’v seen is data repeat structure ex.:
book: author: title: year:
author: title: year:
author: title: year:
( not structure like this but repetitively author: title: year:)
My question is can i use only one level like
root… then put over 1000 items and no one in repeat
ex: book
<Book>
<page1>txtblablabla</page1>
<page2>txtblablabla</page2>
<page3>txtblablabla</page3>
<page4>txtblablabla</page4>
..to page 1000
</Book>
Again… i’m questionning just because all XML example are about data redundancy
My apps will generate a XML from text tab delimited from excel
To desktop layout software whos take xml for array input
Thanks
You can. That would make writing a validating parser/DTD a bit difficult and make it harder to deal with in code. Probably the more correct XML way to do that would be:
<book>
<page number="1">text blah blah blah</page>
<page number="2">text blah blah blah</page>
...
<page number="4059403">really big book</page>
</book>
Thus, when creating you just set the attribute number
. You don’t have to create dynamic tag names. Also when parsing, you can parse into an object (if desired) and your object can mimic the XML directly (i.e. Page.Content = "text blah..."
, Page.Number = 10
).
Thanks Jeremy
All data are come from text input file… even tag name
The app will only build structure around to make a valid XML
my part is to detect where a table start with the chapter title…
write each entry and its own tag name…
then detect the end with double ( return )… and close the chapter tag
all chapter tag will be unique, as all entry inside each chapter
Yes the excel must be well format before