RE: [xml] How can I get namespaces of schematypes ?



Hi !

Thanxs a lot for adding targetnamespace that fast. It works fine for types. It would be nice, if it would 
work for subelems too. Take this schema for example:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="urn:bsp" xmlns:t="urn:bsp"
elementFormDefault="qualified" attributeFormDefault="unqualified" 
xmlns:xs="http://www.w3.org/2001/XMLSchema"; >

        <xs:element name="baselem" type="t:mybase"/>

        <xs:complexType name="mybase">
                <xs:sequence id="baseseq">
                        <xs:element name="base1" type="xs:string"/>
                        <xs:element name="base2" type="xs:string"/>
                </xs:sequence>
        </xs:complexType>

</xs:schema>

I get the namespace of t:mybase - very fine. But if I look at the subtypes of t:mybase, I get name base1 and 
base2 but targetnamespace="". As workaround I take the namespace of mybase and write it in my wrapper class, 
but it would be nice to get it directly from the struct xmlSchemaTypePtr.

 
I would not recommend using the structs to access the data. Try to use
accessor functions. If you have finished them, send them to this mailing
list with a subject like: "I give you some functions" :-)
The hope here, for the future is, that the multi-purpose structs can be
mapped more clearly to the schema components defined by the spec. But
maby Daniel again has one of this superb ideas how to do this in a
different, possibly simpler, manner.
I hope I find enough time to write some accessor functions in xmllib style. I have written a C++ Com 
Interface Wrapper for most common uses. I 'll work on xmlstyle accessor functions and use them in my Wrapper 
and send it to you, but time is short.

By the way:
in libxslt/xsltwin32config.h there is:
/**
 * LIBXSLT_VERSION_EXTRA
 *
 * extra version information, used to show a CVS compilation
 */
#define LIBXML_VERSION_EXTRA "-CVS964"
And I get a compilation error (not with the standard build method, but I´m using a different build system, 
where I get 
xslt.c(50) : error C2146: syntax error : missing ';' before identifier 'LIBXSLT_VERSION_EXTRA'
xslt.c(50) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
xslt.c(50) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
xslt.c(50) : error C2143: syntax error : missing ';' before 'identifier'

Should it be:
/**
 * LIBXSLT_VERSION_EXTRA
 *
 * extra version information, used to show a CVS compilation
 */
#define LIBXSLT_VERSION_EXTRA "-CVS964"

If I use this it builds fine.

Regards, Mike




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]