Hi Jean-David

adding the namespace declaration to the original node should solve 
your problem:

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 
20010904//EN" "http://www.w3.org/TR/2001/REC-SVG-
20010904/DTD/svg10.dtd" [
        <!ATTLIST g testns:aAttr CDATA #IMPLIED>
]>
<svg xml:space="preserve" onload="init(evt)" 
xmlns="http://www.w3.org/2000/svg"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; 
xmlns:testns="http://www.igorion.com/ns/testns";>
        <script type="text/ecmascript">
        <![CDATA[ 
        var svgRoot;    
        function init(evt) {
                svgRoot = svgDocument.getDocumentElement();     
                nodeString = printNode(svgDocument.getElementById
('an'));
                alert(nodeString);
                nodeReparsed = parseXML
(nodeString,svgDocument).getFirstChild();
                alert(printNode(nodeReparsed));
        }
        ]]>
        </script>
        <g id="an" testns:aAttr="123" 
xmlns:testns="http://www.igorion.com/ns/testns";><circle r="10" /></g>
</svg>


cheers, hannes

--- In [EMAIL PROTECTED], Jean-David Benamou <jean-
[EMAIL PROTECTED]> wrote:
> 
> Hi,
> I have add a custom attribute to my SVG document :
> 
> <?xml version="1.0" standalone="no"?>
> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
> "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd";
> [<!ATTLIST text
> customNS:scale CDATA #IMPLIED
> customNS:npath CDATA #IMPLIED>
> ]>
> 
> Now the problem occurs when I "printNode" some node
> to a string and then "parseXML" it back :
> 
> if the node contains one of these custom attributes then
> parseXML skips every elements from the element containing
> this custom attribute.
> 
> Is there a problem using parseXML with custom Attributes ?
> Do I have in some way to "pass" the DTD extension to parseXML ???
> 
> Thanks
> JD



------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/1U_rlB/TM
--------------------------------------------------------------------~-> 

-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> 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/
 

Reply via email to