On Fri, 2012-01-06 at 11:47 -0500, Thomas Gagne wrote:
> I'm unclear how I can reformat the file
> 
>     tgagne@ubuntu:~/tmp$ cat a.xml
>     <ns:a>
>     </ns:a>
> 
> without getting the errors

First fix the namespace error in your document.

If that's not possible, and you want to retain the undeclared prefix,
you could make a wrapper file and use an entity reference to include the
fragment, and then post-process e.g. with XSLT to remove the wrapper.

Or use sed or perl (if this is linux at least) to remove the namespace
declaration afterwards.

However, it would be best to fix the file. e.g. to
<ns:a xmlns:ns="http://www.example.org/ns";>....</ns:a>

With regards,

Liam


-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/

_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml

Reply via email to