[Petal] Minor namespace support bug
Jean-Michel Hiver
jhiver at mkdoc.com
Thu Jan 30 11:57:17 GMT 2003
> Sorry about the missing attachment! Here are the test cases.
Hi again,
I have fixed the petal namespace bug and will release Petal 0.83
shortly.
I really like the idea of meta-templates:
[jhiver at frogette test_ns_attributes]$ cat test_ns_attributes5.xml
<foo xmlns:petal="http://purl.org/petal/1.0/"
xmlns:petal-temp="urn:pepsdesign.com:petal:temp">
<bar baz="default"
petal:attributes="baz default"
petal-temp:attributes="petal:attributes
string:baz ${baz_value}" />
</foo>
This template forces you to hack into Petal's internals by manually
setting $Petal:NS and $Petal:NS_URI, which is __VERY BAD__ :)
Instead, use Petal namespace support to your advantage: (Instead of
using petal-temp I'll use the 'petal-meta' prefix)
[jhiver at frogette test_ns_attributes]$ cat test_rightWayOfDoing.xml
<foo xmlns:petal="http://purl.org/petal/1.0/willBeReplaced"
xmlns:petal-meta="http://purl.org/petal/1.0/"
petal-meta:attributes="xmlns:petal string:http://purl.org/petal/1.0/">
<bar baz="default"
petal:attributes="baz default"
petal-meta:attributes="petal:attributes string:baz ${baz_value}" />
</foo>
You don't have to hack any code and it works just as well :)
Cheers,
--
Building a better web - http://www.mkdoc.com/
---------------------------------------------
Jean-Michel Hiver
jhiver at mkdoc.com - +44 (0)114 255 8097
Homepage: http://www.webmatrix.net/
More information about the Petal
mailing list