Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / January 2006



Tip: Looking for answers? Try searching our database.

Problem parsing XML with NSXMLDocument

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tom Davies - 22 Jan 2006 13:00 GMT
I'm trying to build a DOM tree from an XML document thus:

NSError *error = nil;
NSXMLDocument* xmlDoc = [[NSXMLDocument alloc] initWithData:data
options:0 error:&error];

This gives me the error:

Domain=NSXMLParserErrorDomain Code=201 UserInfo={
    NSLocalizedDescription = "Line 349: Namespace prefix xsi for type
on color is not defined\n";
}

My document looks like:

<?xml version="1.0"?>
<bl:template xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:sfa="http://developer.apple.com/namespaces/sfa"
    xmlns:sf="http://developer.apple.com/namespaces/sf"
    xmlns:bl="http://developer.apple.com/namespaces/bl"
    xmlns:sl="http://developer.apple.com/namespaces/sl"
bl:version="2005112100"
    bl:compatible-version="2005092101" sfa:ID="BLDomainModel-0">
    <bl:domain sf:name="Untitled">
        <bl:metadata>
...
<bl:BLMetadataBrowserBackgroundColor>
                            <bl:color
xsi:type="sfa:calibrated-rgb-color-type"
                                sfa:r="0.96078431606292725"
sfa:g="0.95686274766921997"
                                sfa:b="0.95686274766921997" sfa:a="1"/>
                        </bl:BLMetadataBrowserBackgroundColor>

My XML knowledge isn't good enough to figure out what problem this is
actually describing.

Thanks,
  Tom
David Phillip Oster - 23 Jan 2006 00:24 GMT
> I'm trying to build a DOM tree from an XML document thus:
>
[quoted text clipped - 32 lines]
> My XML knowledge isn't good enough to figure out what problem this is
> actually describing.

Yes, I haven't looked in to it in detail, but I've noticed that too. I
just ignored NSXMLDocument, and used libXML. libXML should have no
trouble parsing that file.
Tom Davies - 23 Jan 2006 11:53 GMT
>>I'm trying to build a DOM tree from an XML document thus:
[snip]
> Yes, I haven't looked in to it in detail, but I've noticed that too. I
> just ignored NSXMLDocument, and used libXML. libXML should have no
> trouble parsing that file.

Thanks David, that did the trick!

Tom
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.