>From: Javier
>Sent: Friday, September 9, 2011 1:06 AM
>
> Hi Dave,
>   Thanks for your help to solve the problem about generated parser
> can't load the third tag. I still have a problem. The elements of
> xml document produced by a call to an export method lost the
> namespace prefixes.
> 
> The original xml document:
> <abc:people xmlns:abc="http://www.abc.com/namespace";>
>     <abc:person>
>        <abc:a>1</abc:a>
>         <abc:b>2</abc:b>
>     </abc:person>
> </abc:people>
> The  produced xml document by a call to an export method :
> <people xmlns:abc="http://www.abc.com/namespace";>
>      <person>
>         <a>1</a>
>         <b>2</b>
>     </person>
> </people>
> 
> I dont know the reason. Can you help me?
> 
> Attached are the XSD, xml , generated Python data structures and the test 
> files.
> 
> P.s the generateDS version is the newest version which you sent to me.
> 
> Thanks with best regards,
> 
> 

Javier -

Good to hear from you again.

OK.  Admittedly, generateDS.py does not handle namespace prefixes
really well.  But, ...

The export() method in each generated class has a namespace_
argument.  When you call the export try, passing in a value for that.
For example:

        my_top_level_element.export(sys.stdout, 0, namespace_="myprefix:")


Perhaps that will do what your need.  Take a look at the generated code
to see how that argument is used.

Let me know if that works for you.  If it does not work, please let
me know so that I can look into it.

- Dave


 

-- 


Dave Kuhlman
http://www.rexx.com/~dkuhlman


------------------------------------------------------------------------------
Malware Security Report: Protecting Your Business, Customers, and the 
Bottom Line. Protect your business and customers by understanding the 
threat from malware and how it can impact your online business. 
http://www.accelacomm.com/jaw/sfnl/114/51427462/
_______________________________________________
generateds-users mailing list
generateds-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/generateds-users

Reply via email to