LISTSERV mailing list manager LISTSERV 16.0

Help for XML-L Archives


XML-L Archives

XML-L Archives


XML-L@LISTSERV.HEANET.IE


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

XML-L Home

XML-L Home

XML-L  July 2000

XML-L July 2000

Subject:

Re: General XML Parsing... Part 2

From:

Chris Bove <[log in to unmask]>

Reply-To:

General discussion of Extensible Markup Language <[log in to unmask]>

Date:

Fri, 28 Jul 2000 12:26:48 -0400

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (104 lines)

David, all-

OmniMark can be used to convert documents in either direction, but the
programmer has to supply the logic.
When converting from XML to another format (typically referred to as a
DOWN-TRANSLATE) the rules come in the form of element event rules.  The
element event rules fire as the specific element is encountered by the
parser.  For example:

...
element title
        output "<h1>TITLE:</h1>%c"
...

This rule would take a given title element and change it to some html.  The
"%c" represents the content of the title element (this could be other nested
elements, which would then need their own rules for processing).

When converting from some lesser structured formats to XML (typically
referred to as an UP-TRANSLATE) you have to use pattern matching rules to
make your changes.  For example:

...
find "{\p00234"
        do when open element is para0
                output "</para0>"
        done
        output "<para0>"
...

This rule finds some pattern you want to convert to the beginning of a para0
element and outputs the appropriate tag.  Furthermore, it demonstrates how
you can ask the parser where it is in the tree and apply logic based on
that.  In the example it says basically - Considering all the output I've
sent you so far, if there is an open 'para0' element then output this
string.  In this case its an end tag and the parser will recognize this
after its been output.  After running, any errors that occured will be
reported in a log file, or if you're daring, you can catch the errors as
they occur and supply even more logic.  This allows you to handle or at
least identify abnormalities in the source input and in the output.

These are pretty simple examples, but I mean to show how OmniMark can make
use of the parser to do conversions.  As with anything, there's no magic
bullet for conversion, somewhere along the way someone has to supply the
logic to make use of the tool.  There are some OmniMark scripts that are
freely available that do conversions from rtf (or .mif or whatever) to
SGML/XML, but again you would still need to customize the output to fit your
own DTD's requirements.


Chris




-----Original Message-----
From: Shelton, David C
To: [log in to unmask]
Sent: 7/28/00 10:01 AM
Subject: General XML Parsing... Part 2

First,

Thanks for the suggestions. I'm looking into OmniMark and XSL.

Second,

If anyone can give a quick answer, is there a way to take an unknown XML
document (with a DTD) and convert it to a CDF or EDI file using OmniMark
or
XSL? In other words, would I be able to write an XSL file (or Set up
OmniMark) to take any XML file and convert it with out having to
customize
it for each XML format that comes in?

And, going in the reverse, can I use OmniMark to make an XML file out of
a
different format (I don't think XSL will work, right?). OR what about
the
IBM and SUN parsers/tools?

My problem is that I need to be able to convert XML files into a flat
file
format, and I also need to take a file format (unknown, but should be
similar to flat file) and create XML files. I will always have a DTD (a
requirement) to make sure everything is correct.

So I guess the best question would be, is there any tools/parsers that
will
return the DTD structure so I can programmatically create an XML file
based
off of it? Any URL's that may point to the information or names of tools
that I can search for is greatly appreciated.

(Note: I'm new to XML, but understand the general document object model)

Thanks,

david

--
David C. Shelton
[log in to unmask]
UNISYS  -  Software Engineer

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

February 2017
August 2016
June 2016
March 2016
January 2016
July 2014
April 2014
January 2014
July 2013
February 2013
September 2012
August 2012
October 2011
August 2011
June 2011
January 2011
November 2010
October 2010
July 2010
June 2010
March 2010
February 2010
January 2010
November 2009
September 2009
August 2009
July 2009
May 2009
March 2009
December 2008
October 2008
August 2008
May 2008
March 2008
February 2008
January 2008
December 2007
October 2007
August 2007
June 2007
March 2007
January 2007
December 2006
September 2006
July 2006
June 2006
April 2006
February 2006
January 2006
November 2005
September 2005
August 2005
July 2005
June 2005
May 2005
March 2005
January 2005
October 2004
August 2004
July 2004
June 2004
May 2004
March 2004
February 2004
January 2004
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
January 2001
December 2000
November 2000
October 2000
September 2000
August 2000
July 2000
June 2000
May 2000
April 2000
March 2000
February 2000
January 2000
December 1999
November 1999
October 1999
September 1999
August 1999
July 1999
June 1999
May 1999
April 1999
March 1999
February 1999
January 1999
December 1998
November 1998
October 1998
September 1998
August 1998
July 1998
June 1998
May 1998
April 1998
March 1998
February 1998
December 1997
November 1997
October 1997

ATOM RSS1 RSS2



LISTSERV.HEANET.IE

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager