Okay, that is not quite right.

I have a piece of XML Schema contained in externalTool.xsd that I churn
through generateDS-1.15b and it contains the following:
         <xsd:element name="GotTelemetryFor">
          <xsd:complexType>
           <xsd:sequence>
            <xsd:element name="telemetry" minOccurs="0"
maxOccurs="unbounded">
             <xsd:complexType>
              <xsd:sequence>
               <xsd:element name="channel" type="xsd:normalizedString"/>
               <xsd:element name="value" type="xsd:normalizedString"/>
               <xsd:element name="raw" type="value"/>
              </xsd:sequence>
             </xsd:complexType>
            </xsd:element>
           </xsd:sequence>
           <xsd:attribute name="validKey" type="xsd:boolean"
default="true" />
          </xsd:complexType>
         </xsd:element>

The "value" type for the tag "raw" is contained in another file called
value.xsd that I never import from within externalTool.xsd.

Now, when the parsing gets down to handling the raw tag, I get the error
I posted in the original post. I have since modified the code to be:

            for text__content_ in child_.childNodes:
                print text__content_.nodeValue

and now I get:

[<DOM Element: boolean at 0x2127cf8>]
None
[<DOM Element: boolean at 0x212aea8>]
None
[<DOM Element: boolean at 0x212c098>]
None
[<DOM Element: boolean at 0x212c680>]
None
[<DOM Element: boolean at 0x212b4d0>]
None

Is this because externalTool.xsd does not import or know about value.xsd
or some more pathological condition?

On Tue, 2008-12-16 at 11:13 -0800, Al Niessner wrote:
> I am having a problem parsing some valid XML (has been validated with
> another tool) using the output from generateDS-1.15b. I have a schema
> that contains an attribute with a default value. In my XML, the
> attribute is not given and the parser is dying:
> 
> /tmp/BleedingEdge/SciPyScripts/toolInterface.py in buildChildren(self,
> child_, nodeName_)
>    1414             raw_ = ''
>    1415             for text__content_ in child_.childNodes:
> -> 1416                 raw_ += text__content_.nodeValue
>    1417             self.raw = raw_
>    1418 # end class telemetry
> 
> <type 'exceptions.TypeError'>: cannot concatenate 'str' and 'NoneType'
> objects
> 
> I can take some time to make a test case of very few lines that
> illustrate this problem, but I did not know if this is known and has a
> work around associated with it. Please let me know if a test case would
> help or what the work around is.
> 
> Thanks.
> 
> --
> Al Niessner
> 818.354.0859
> 
> All opinions stated above are mine and do not necessarily reflect those
> of JPL or NASA.
> 
> --------
> |  dS  | >= 0
> --------
> 
> 
> 
> ------------------------------------------------------------------------------
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> The future of the web can't happen without you.  Join us at MIX09 to help
> pave the way to the Next Web now. Learn more and register at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> _______________________________________________
> generateds-users mailing list
> generateds-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/generateds-users
-- 
Al Niessner
818.354.0859

All opinions stated above are mine and do not necessarily reflect those
of JPL or NASA.

--------
|  dS  | >= 0
--------



------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
generateds-users mailing list
generateds-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/generateds-users

Reply via email to