On Fri, Apr 6, 2012 at 10:34 PM, N. Max Pierson <nmaxpier...@gmail.com> wrote:
> Hi Peter,
>
> Thanks for the reply.
>
> First, I should say that I'm rather new to python and PyXB, so please be
> patient with my ignorance :)
>
> I was guessing that it wouldn't work because there's no element's specified
> in that specific document??

No, that'd be ok.  It defines attributes, so it's not useless.

> I need to make use of the "xml:lang" attribute in a document that's
> surrounded in a netconf project that I am working on. The netconf.xsd file I
> have imports the xml.xsd file. Then the other xsd files I have imports the
> netconf.xsd file. I am not having any issues with the netconf.xsd (and a few
> of the other xsd files I was supplied so far).

OK.  Yes, a binding for netconf.xsd can be created without doing
anything special.  Although it imports the XML namespace, that gets
resolved into a reference to Python's built-in namespace for xml:lang.
 See http://pyxb.sourceforge.net/api/pyxb.namespace.builtin._XML-class.html

> So I guess as far as validation is concerned, if the xml.xsd is imported for
> use of the xml:lang attribute, it will still validate even though I do not
> have a binding for it??

You should have a binding for it.  If you look at the generated
binding for netconf, you'll see an anonymous complex type that
references the built-in definition of xml:lang.

> I'm still reading up on the documentation for the PyXB module, so my
> understanding of still minimal of what all "bindings" are needed to validate
> against the xsd files I have and how the bindings are used in building the
> modules created by PxYB.

PyXB should complain if it needs to get information from an imported
namespace and doesn't already have the necessary binding information
(which it can find from builtin namespaces, namespaces for which it
can locate a pre-generated archive, and namespaces for which it can
find schemas by retrieving a URI from a schemaLocation).  Only then do
you need to manually generate bindings for those namespaces.  See
http://pyxb.sourceforge.net/userref_pyxbgen.html#sharing-namespace-bindings
and other material in that area of the documentation.

Depending on how the schema for the overall project are constructed,
you may want to do:

pyxbgen -u netconf.xsd -m netconf --archive-to-file netconf.wxs

then:

pyxbgen -u other.xsd -m other --archive-path .:+

if the "other.xsd" schema references netconf.  Do the same thing for
other namespaces that are imported into multiple schemas.  The
alternative is to generate bindings for all the schemas at once, as
with 
http://pyxb.sourceforge.net/userref_pyxbgen.html#generating-related-namespaces.

Peter

>
> Regards,
> Max
>
>
> On Fri, Apr 6, 2012 at 5:43 PM, Peter Bigot <big...@acm.org> wrote:
>>
>> Sorry for the delay; somehow this got tagged as spam.
>>
>> http://www.w3.org/XML/1998/namespace is a built-in namespace, and
>> can't be generated from a schema.  pyxb doesn't have a binding for it,
>> but does recognize and process elements/attributes in that namespace
>> in both schema and documents.
>>
>> Maybe I missed a use-case: what are you trying to do that you need a
>> binding for it?
>>
>> Peter
>>
>> On Wed, Apr 4, 2012 at 10:21 PM, N. Max Pierson <nmaxpier...@gmail.com>
>> wrote:
>> > Hi,
>> >
>> > I'm getting a warning from pyxbgen when trying to generate a module for
>> > XML
>> > Namespace located here http://www.w3.org/XML/1998/namespace
>> >
>> > The source xsd can be found here http://www.pyxlmap.com/xml.xsd and the
>> > warning messages are as follows ...
>> >
>> > **!!**!! Not destroying builtin
>> > {http://www.w3.org/XML/1998/namespace}lang:
>> > STD[<anonymous>:restriction of anySimpleType
>> >   pattern="",enumeration=""]
>> > Replacing unresolved AD[{http://www.w3.org/XML/1998/namespace}lang:?]
>> > **!!**!! Not destroying builtin
>> > {http://www.w3.org/XML/1998/namespace}base:
>> > STD[anyURI:restriction of anySimpleType
>> >
>> >
>> > pattern="",minLength="None",length="None",maxLength="None",whiteSpace="collapse",enumeration=""]
>> > Replacing unresolved AD[{http://www.w3.org/XML/1998/namespace}base:?]
>> > **!!**!! Not destroying builtin
>> > {http://www.w3.org/XML/1998/namespace}id:
>> > STD[ID:restriction of NCName]
>> > Replacing unresolved AD[{http://www.w3.org/XML/1998/namespace}id:?]
>> > Replacing unresolved
>> > AGD[{http://www.w3.org/XML/1998/namespace}specialAttrs]
>> > Python for xml=http://www.w3.org/XML/1998/namespace requires 1 modules
>> > WARNING: No binding file for
>> > NM:xml=http://www.w3.org/XML/1998/namespace@base
>> >
>> > And the module does not get built. Any ideas?
>> >
>> > Regards,
>> > Max
>> >
>> >
>> > ------------------------------------------------------------------------------
>> > Better than sec? Nothing is better than sec when it comes to
>> > monitoring Big Data applications. Try Boundary one-second
>> > resolution app monitoring today. Free.
>> > http://p.sf.net/sfu/Boundary-dev2dev
>> > _______________________________________________
>> > pyxb-users mailing list
>> > pyxb-users@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/pyxb-users
>> >
>
>

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
pyxb-users mailing list
pyxb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyxb-users

Reply via email to