OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   RE: [xml-dev] Text to XML

[ Lists Home | Date Index | Thread Index ]


Le lundi 23 janvier 2006 à 12:15 -0500, DuCharme, Bob (LNG-CHO) a
écrit :
> Tarun wrote:
> >I have a requirement in which I need to convert some text output of
> some command into xml so that I >can parse it with a parser based upon
> some schema. I also have xml file(annotation) for that output.  >Can
> anybody suggest me some already available tool for it?
> Most people prefer a language with good pattern matching capabilities
> such as perl or python to identify the appropriate information in the
> input and then wrap it with tags and/or store your found strings as
> attributes of those tags. 

XSLT 2.0 can be considered as such a language and it can read your text

> For complex data, you'll save yourself some headaches if you do it in
> multiple passes instead of trying to do it all at once. Creating a
> simplified, dumbed-down version of the XML and then using XSLT to
> convert that to XML conforming to your schema may be something to
> consider for your last pass.

Unless you're using XSLT 2.0 from the beginning in which case you can
use it to perform your multiple steps and the final adaptation to your

It requires to know enough of the language to use it (which shouldn't be
underestimated if you don't know XSLT at all), but it can be considered
a serious option to do this kind of task.

GPG-PGP: 2A528005
Did you know it? Python has now a Relax NG (partial) implementation.
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
(ISO) RELAX NG   ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema

Ceci est une partie de message=?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?=


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS