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

Re: Ten Years Later - XML 1.0 Fifth Edition?

  • From: Philippe Poulard <philippe.poulard@s...>
  • To: Mukul Gandhi <gandhi.mukul@g...>
  • Date: Mon, 18 Feb 2008 18:12:52 +0100

Re:  Ten Years Later - XML 1.0 Fifth Edition?
Mukul Gandhi a écrit :
> The problem I was having is - Given a root directory, I needed to
> generate a XML hierarchy depicting the file system hierarchy, starting
> from the given root. I wrote a recursive Java program and converted
> the information to XML, using Xerces DOM implementation.
> 
> Some of the directory/file names didn't conform to the XML name
> conventions. Like, some directory names started with numeric. Some
> contained characters like - (hyphen), ~ etc.
> 
> Would somebody agree with me, that XML names should allow such rules?
> My problem could serve as a use case ...
> 

Hi,

When people have to process a non-XML structure as XML, they try to 
invent some tags that are constraints by XML rules ; as you said, some 
of the directory/file names doesn't conform to the XML names.

Additionally, when you dump a structure such as a file system to a 
markup representation, you'd have enough time to take a coffee if you 
start from the root...

My own thoughts lead me to the following : it's much more better to deal 
with the data model rather than to cope with the tags, you will be able 
to relax some constraints that you dislike for a specific usage.

This is what I've done in RefleX :
http://reflex.gforge.inria.fr/
A file system is an XML-friendly object : you can apply XPath 
expressions on it.

For example, start with a given directory :
<xcl:set name="dir" value="{io:file('file:///some/dir/')}"/>

Then get a file within :
$dir/someDoc.xml
$dir/subdir/someDoc.xml
$dir/../../subdir/someDoc.xml

Get a set of files :
$dir/*
$dir//*
$dir//*[@io:extension='xml']
$dir//*[name(..) != 
'WEB-INF'][@io:extension='xml']$dir//*[@io:extension='xml' and @io:size 
 > 1024]

Have to deal with an illegal XML name ?
$dir/*[name()='An illegal XML name but a valid file name']

In RefleX, the entire file system won't be mapped to tags, the system 
will access only to the directories involved in the navigation during 
the XPath evaluation.

If you argue that the Unix "find" command can do the job, I'll answer 
that (1) it works only on Unix, (2) it works only on a local file system 
whereas RefleX works as well on http, ftp, webdav, zip, tar... (3) you 
don't have to learn an obscure syntax, it's XPath !!!

Enjoy !

-- 
Cordialement,

               ///
              (. .)
  --------ooO--(_)--Ooo--------
|      Philippe Poulard       |
  -----------------------------
  http://reflex.gforge.inria.fr/
        Have the RefleX !


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


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.