namespace handling fixes

I just comitted some code that should handle namespaces properly when saving.
I've removed all the manual xmlns declarations that were stuck in the code; instead, they are now generated automatically and inserted into the output document on save.
The new code can also use a specified namespace as the default namespace in a saved document, when it is possible to do so. Under normal circumstances we now save documents with SVG as the default namespace.
Test and let me know if anything broke (it seems okay on my end).
-mental

I'm having a small problem with open/close tags mismatching. For example, I make a group node with:
groupRepr = sp_repr_new("svg:g");
...and what is generated during a save is <g> ....stuff....</svg:g>
Looks like the same is happening for <metadata> tags. Maybe this is a difference between trivial and paired tags.
Bob
MenTaLguY wrote:
I just comitted some code that should handle namespaces properly when saving.
I've removed all the manual xmlns declarations that were stuck in the code; instead, they are now generated automatically and inserted into the output document on save.
The new code can also use a specified namespace as the default namespace in a saved document, when it is possible to do so. Under normal circumstances we now save documents with SVG as the default namespace.
Test and let me know if anything broke (it seems okay on my end).
-mental

On Tue, 4 Jan 2005, Bob Jamison wrote:
I'm having a small problem with open/close tags mismatching. For example, I make a group node with:
groupRepr = sp_repr_new("svg:g");
...and what is generated during a save is <g> ....stuff....</svg:g>
Looks like the same is happening for <metadata> tags. Maybe this is a difference between trivial and paired tags.
Aha. Good catch. I wonder why libxml didn't complain? Even though g and svg:g have the same expanded name, <g>...</svg:g> still isn't syntactically valid.
-mental

On Tue, 4 Jan 2005, Bob Jamison wrote:
I'm having a small problem with open/close tags mismatching. For example, I make a group node with:
groupRepr = sp_repr_new("svg:g");
...and what is generated during a save is <g> ....stuff....</svg:g>
Looks like the same is happening for <metadata> tags. Maybe this is a difference between trivial and paired tags.
Easy to fix anyhow; just update the other places in sp_repr_write_element to use element_name rather than sp_repr_name().
-mental
participants (2)
-
Bob Jamison
-
MenTaLguY