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

Using expat to translate tags..

  • From: Tony McDonald <tony.mcdonald@n...>
  • To: xml-dev@i...
  • Date: Tue, 8 Dec 1998 10:37:30 +0000

using expat
Hi,
I'm using expat along with the XML support in PHP 3.0.6 
(http://www.php.net) to do some machinations on some XML files I have.

What I have is some XML like this...
<p stylename="heading 1" align="center" fontname="Arial" fontsize="72" 
bold="on" charset="256" color="1"><string>&tab;</string><string 
fontname="Arial" fontsize="72" bold="on" charset="256" color="1">MBBS STAGE 
1: &line;</string><string fontname="Arial" fontsize="72" bold="off" 
italic="on" charset="256" color="1">Basic Cell Biology</string></p>

(this was created with rtf2xml from Omnimark)

and want to be able to change the XML so that I get something like;
<heading_1>MBBS STAGE 1 - Basic Cell Biology</heading_1>   (ok, I'll 
*actually* end up replacing heading_1 with H1...)

ie, I want to output a different tag which is dependant on the value of the 
'stylename' attribute.

It seems that although expat will provide the start_element routine with 
information such as the tag and any attribute, the attributes are dropped 
when the end_element routine is called. This seems to make it difficult to 
close the tag properly....

Has anyone any ideas? Am I going about this wrongly?

many thanks,
tone


------
Dr Tony McDonald,  FMCC, The Medical School, Newcastle University
Tel: +44 191 222 5888 Fax +44 191 222 5016
Fingerprint: 3450 876D FA41 B926 D3DD  F8C3 F2D0 C3B9 8B38 18A2

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)


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.