XM_FORMATTER
"Stephanie Balzer" <[email protected]>
| Newsgroups | gmane.comp.lang.eiffel.gobo.general |
|---|---|
| Message-ID | <[email protected]> |
Hi
In my application I'd like to create an xml file. I defined the following
classes:
<> XMLIZER inherit XM_FORWARD_CALLBACKS: generates the xml events
<> ROOT_CLASS inherit KL_SHARED_ARGUMENTS, KL_SHARED_STANDARD_FILES:
Uses XM_TREE_CALLBACKS_PIPE to create a XM_DOCUMENT and XM_FORMATTER to
write the XM_DOCUMENT into a file.
I'd like to create the following xml document:
<?xml version='1.0' encoding='utf-8'?>
<!-- A xml example -->
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
Thus, I generate the events as follows:
on_start
on_xml_declaration ("1.0", "utf-8", True)
on_comment ("A xml example")
on_start_tag (Void, Void, "note")
on_start_tag_finish
on_content ("%R")
on_content ("%T")
on_start_tag (Void, Void, "to")
on_start_tag_finish
on_content ("Tove")
on_end_tag (Void, Void,"to")
on_content ("%R")
on_content ("%T")
on_start_tag (Void, Void, "from")
on_start_tag_finish
on_content ("Jani")
on_end_tag (Void, Void, "from")
on_content ("%R")
on_content ("%T")
on_start_tag (Void, Void, "heading")
on_start_tag_finish
on_content ("Reminder")
on_end_tag (Void, Void, "heading")
on_content ("%R")
on_content ("%T")
on_start_tag (Void, Void, "body")
on_start_tag_finish
on_content ("Don't")
on_content (" ")
on_content ("forget")
on_content (" ")
on_content ("me")
on_content (" ")
on_content ("this")
on_content (" ")
on_content ("weekend!")
on_end_tag (Void, Void, "body")
on_content ("%R")
on_end_tag (Void, Void, "note")
on_finish
Unfortunately, what I get is:
<!--A xml example--><note xmlns="" xmlns:ns1="">
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
As you can see, the xml definition is missing and the note tag shows some
attributes. What did I do wrong?
Thanks for any help,
Stephanie
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~->
To Post a message, send it to: [email protected]
To Unsubscribe, send a blank message to: [email protected]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/gobo-eiffel/
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/