Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^4: Generating elements with attributes and contents using XML::Smart

by pfaut (Priest)
on Aug 20, 2004 at 12:23 UTC ( [id://384584]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Generating elements with attributes and contents using XML::Smart
in thread Generating elements with attributes and contents using XML::Smart

I made these corrections to my full program and DTD and I still have a problem. If I have a 'type' element defined, then the 'type' attribute is still getting converted to a tag inside the 'phone' element.

use XML::Smart; my $xml = XML::Smart->new; $xml->{customer}{phone} = "555-1234"; $xml->{customer}{phone}{type} = "home"; $xml->apply_dtd(<<EOF); <?xml version="1.0" ?> <!DOCTYPE customer [ <!ELEMENT customer (type?,phone+)> <!ELEMENT phone (#PCDATA)> <!ATTLIST phone type CDATA #REQUIRED> <!ELEMENT type (#PCDATA)> ]> EOF print $xml->data;

This produces:

<customer> <phone> <type>home</type>555-1234</phone> </customer>
90% of every Perl application is already written.
dragonchild

Replies are listed 'Best First'.
Re^5: Generating elements with attributes and contents using XML::Smart
by gmpassos (Priest) on Sep 01, 2004 at 18:34 UTC
    Fixed on XML::Smart 1.6.8! Thanks for the report.

    Graciliano M. P.
    "Creativity is the expression of the liberty".

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://384584]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-19 21:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found