[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: tree with xml

  • From: greg@c...
  • To: Mike Brown <mbrown@w...>
  • Date: Tue, 13 Feb 2001 01:17:44 +0100

directory tree to xml
Hi,

Thanks for our answer, i tought noone would :-)
In the mean time, i browsed through websites and some doc, and had already
understood what you explained to me.
And i've also tried to mess out a little bit with java and php and an xml
file of mine.
It seemed to work ok, except when i tried to do what i wanted to do in the
first place
Something like reproducing a file/directory hierarchy
like
<folder name="root">
    <file>
        <type>doc</type>
        <filename>mytest</filename>
        <last-visited-date>011201</last-visited-date>
    </file>
    <file>
        <type>doc</type>
        <filename>mytest2</filename>
        <last-visited-date>011201</last-visited-date>
    </file>
    <folder name="subdir-test">
        <file>
            <type>doc</type>
            <filename>mytest-insubdir</filename>
            <last-visited-date>011201</last-visited-date>
        </file>
        <folder name="subsubdir">
            <file>
                <type>doc</type>
                <filename>subsubdir-testfile</filename>
                <last-visited-date>011201</last-visited-date>
            </file>
        </folder>
    </folder>
</folder>

See what i mean? The parser i used seemed not the 'see' the <file>'s inside
the <folder>'s, and i didn't really understand what and how to do, so i
decided to ask the mailing list...
So maybe you can point me to some more precise doc, or book ?

Thanks anyway

greg


----- Message d'origine -----
De : "Mike Brown" <mbrown@w...>
À : <greg@c...>
Cc : <xml-dev@l...>
Envoyé : mardi 13 février 2001 0:59
Objet : RE: tree with xml


> > It's probably a stupid-beginner question, but i'm wondering
> > weither its possible to have simple tree (hierarchy, like
> > files and directories ie) utilisation of XML?
>
> Hmm, definitely a beginner question, but not stupid, considering how
> obtusely organized and not-for-the-layman the XML spec is.
>
> You will be happy to learn that XML is a linear syntax for the
> representation of a hierarchical data structure.
>
> A very simplistic view, to get you started, is that the data being
> represented is divided into segments of character data (text strings) and
> nested abstract containers called elements. Elements have names (types,
> rather). An XML document has just one element at the top level, and the
tree
> forms 'below' that. Elements can have associated with them name-value
pairs
> called attributes. Attribute values are typically more character data.
>
> The XML syntax uses markup called tags to indicate element boundaries and
> their attributes. Here is an example of the fundamental syntax:
>
> <greeting xml:lang="en">hello</greeting>
>
> This markup represents an element of type 'greeting' with the character
data
> contents 'hello'. The element has an attribute named 'xml:lang' with a
value
> of 'en'. Please do not confuse the physical markup ("tags") with the
> abstract, logical structures ("elements").
>
> OK, now we'll make that particular 'greeting' element be a child of a
> 'mydoc' element, and we give the greeting element some siblings that are
> empty (content-free) 'foo' elements, demonstrating the two different ways
> allowed to write an empty element:
>
> <mydoc><foo></foo><greeting xml:lang="en">hello</greeting><foo/></mydoc>
>
> I could model the corresponding tree with ASCII art like this:
>
>    element 'mydoc'
>       |___element 'foo'
>       |___element 'greeting'
>       |     |  \___attribute 'xml:lang' w/value 'en'
>       |     |___text 'hello'
>       |___element 'foo'
>
> Whitespace can be significant, so the above is not necessarily the same as
>
> <mydoc>
>    <foo></foo>
>    <greeting xml:lang="en">hello</greeting>
>    <foo/>
> </mydoc>
>
> although I'm sure you'll agree it is much easier to read when text is
> inserted between the tags like that.
>
> As I said, this is just a simplistic introduction to get you started and
to
> demonstrate the hierarchical nature of XML. There's a lot more to know.
Get
> a good book on the subject.


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.