Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 18th, 2009, 06:07 AM
Registered User
 
Join Date: Feb 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default How can I parse xsi:type?

Hello, everyone.

when I use MSXML4.0 to load the XML config file, I meet some question.

The code segment of my xml file is below:

<?xml version="1.0" encoding="UTF-8"?>
<!--DaVinci Network Designer document-->
<fx:FIBEX xmlns:fx="http://www.asam.net/xml/fbx" xmlns:ho="http://www.asam.net/xml" xmlns:can="http://www.asam.net/xml/fbx/can" xmlns:lin="http://www.asam.net/xml/fbx/lin" xmlns:flexray="http://www.asam.net/xml/fbx/flexray" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:vi="http://www.vector-informatik.com/xml/fbx/vector-flexray" xmlns:all="http://www.asam.net/xml/fbx/all" xsi:schemaLocation="http://www.asam.net/xml/fbx/all http://www.asam.net/xml/fbx/2_0_0d/x...tiplatform.xsd" VERSION="2.0.0d">
<fx:PROJECT ID="Project_1">
<ho:SHORT-NAME>FlexRaySystemDemo</ho:SHORT-NAME>
<ho:LONG-NAME>Vehicle</ho:LONG-NAME>
<ho:DESC>This is the FIBEX database for Vector's system demo for FlexRay.</ho:DESC>
</fx:PROJECT>
<fx:ELEMENTS>
<fx:CLUSTERS>
<fx:CLUSTER ID="Cluster_1" xsi:type="flexray:CLUSTER-TYPE">


the last line below can not be parse:
--------------------------------------------------------------------------------------------
<fx:CLUSTER ID="Cluster_1" xsi:type="flexray:CLUSTER-TYPE">
--------------------------------------------------------------------------------------------

I have declare the namespace like this:

pXMLDoc->setProperty("SelectionLanguage", "XPath");
pXMLDoc->setProperty("SelectionNamespaces","xmlns:fx='http ://www.asam.net/xml/fbx' xmlns:flexray='http://www.asam.net/xml/fbx/flexray' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'");

But when I load the xml file, code is below:

IXMLDOMDocument2Ptr pXMLDoc = NULL;
HRESULT hr = pXMLDoc.CreateInstance(__uuidof(DOMDocument40));
// Set parser property settings
pXMLDoc->async = VARIANT_FALSE;
// Load the sample XML file
hr = pXMLDoc->load("davinci.xml");

the error information is:

at line 11,Type '{http://http://www.asam.net/xml/fbx/flexray}CLUSTER-TYPE is not find inSchema.

I see the problem maybe the xsi that can not be identifyed by DOM, I can not resolve this.
please help me!
Thank you very much!
 
Old February 25th, 2009, 03:01 AM
Registered User
 
Join Date: Feb 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Can anyone help me?

Any advice is welcome. :)
 
Old February 25th, 2009, 04:35 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Perhaps the error message means what it says, that the type named in xsi:type is not present in your schema.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
exclude-result-prefixes="#all" and xsi:type maxtoroq XSLT 2 November 7th, 2008 08:46 PM
problem with xsi:SchemaLocation akshay144 XML 2 August 20th, 2008 05:40 AM
Creating xsi:type as an attribute AjayLuthria XSLT 5 May 10th, 2007 09:49 AM
how to parse xml with an attributes of type ID kirkpng XSLT 1 January 25th, 2005 04:44 PM
copy-of xsi namespace chris_strub XSLT 2 October 2nd, 2004 10:32 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.