Hi everybody,
I'm trying to create an XML request that requires the root tag to have
multiple namespace attributes and a prefix specified. To be more
precise, I'm trying to generate a mkcalendar request like this one:
--8<--
<?xml version="1.0" encoding="utf-8" ?>
<C:mkcalendar xmlns="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav"
xmlns:ical="http://apple.com/ns/ical/">
<set>
<prop>
<displayname>Test calendar</displayname>
<ical:calendar-color>#000000ff</ical:calendar-color>
</prop>
</set>
</C:mkcalendar>
-->8--
By using XMLDocument and XMLElement classes from AWL I can generate
everything all right but the prefix on root tag. I have put my code in
pastebin: http://pastebin.com/UFUNuTi9 . As you can see, the root tag is
lacking the specified prefix.
It seems that a default namespace (with no prefix) makes the root tag
to lose its own prefix when adding the list of xmlns's (behaviour found
on SetAttribute() @ XMLElement.php).
Did anyone face the same issue? How did you manage to get the correct
prefix on the root tag? I know I can remove XMLElement relevant lines on
SetAttribute(), but I would like to use AWL as-is.
Thank you. Regards.
--
Jorge L?pez P?rez
http://adobo.org
xmpp:jorge at im.jepsi.org
I'm trying to create an XML request that requires the root tag to have
multiple namespace attributes and a prefix specified. To be more
precise, I'm trying to generate a mkcalendar request like this one:
--8<--
<?xml version="1.0" encoding="utf-8" ?>
<C:mkcalendar xmlns="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav"
xmlns:ical="http://apple.com/ns/ical/">
<set>
<prop>
<displayname>Test calendar</displayname>
<ical:calendar-color>#000000ff</ical:calendar-color>
</prop>
</set>
</C:mkcalendar>
-->8--
By using XMLDocument and XMLElement classes from AWL I can generate
everything all right but the prefix on root tag. I have put my code in
pastebin: http://pastebin.com/UFUNuTi9 . As you can see, the root tag is
lacking the specified prefix.
It seems that a default namespace (with no prefix) makes the root tag
to lose its own prefix when adding the list of xmlns's (behaviour found
on SetAttribute() @ XMLElement.php).
Did anyone face the same issue? How did you manage to get the correct
prefix on the root tag? I know I can remove XMLElement relevant lines on
SetAttribute(), but I would like to use AWL as-is.
Thank you. Regards.
--
Jorge L?pez P?rez
http://adobo.org
xmpp:jorge at im.jepsi.org