Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT 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 January 28th, 2012, 05:13 PM
Authorized User
 
Join Date: May 2009
Posts: 14
Thanks: 3
Thanked 0 Times in 0 Posts
Default XSD namespace and xml validation issue

Hi, I have the following schema.

Code:

HTML Code:
 
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://BioArchR2_Email_Notifications_Pipeline.CustomerAck" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" targetNamespace="http://BioArchR2_Email_Notifications_Pipeline.CustomerAck" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="esbEvent">
    <xs:annotation>
      <xs:appinfo>
        <b:properties>
          <b:property distinguished="true" xpath="/*[local-name()='esbEvent' and namespace-uri()='http://BioArchR2_Email_Notifications_Pipeline.CustomerAck']/*[local-name()='header' and namespace-uri()='']/*[local-name()='errorNumber' and namespace-uri()='']" />
        </b:properties>
      </xs:appinfo>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element name="header">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="eventDateTime" type="xs:string" />
              <xs:element name="interfaceName" type="xs:string" />
              <xs:element name="transID" type="xs:string" />
              <xs:element name="resultCode" type="xs:string" />
              <xs:element name="errorNumber" type="xs:string" />
              <xs:element name="contentCount" type="xs:string" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="resultDescription">
          <xs:complexType>
            <xs:sequence>
              <xs:element minOccurs="0" maxOccurs="unbounded" name="error" type="xs:string" />
              <xs:element minOccurs="0" maxOccurs="unbounded" name="warning" type="xs:string" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
 
-----------------------------
When I validate the sample given below against the schema, I get an error. The sample and error are given below.

HTML Code:
<esbEvent xmlns="http://BioArchR2_Email_Notifications_Pipeline.CustomerAck">
<header>
  <eventDateTime>01/12/2012 10:25:29 AM</eventDateTime> 
  <interfaceName>CFS.Customer</interfaceName> 
  <transID>PhoneTest20120106sg.xml01-12-2012 10:16:26.0</transID> 
  <resultCode>-1</resultCode> 
  <errorNumber>3</errorNumber> 
  <contentCount>0</contentCount> 
  </header>
<resultDescription>
  <error>Error</error> 
  <error>INTERNAL_ERROR Error</error> 
  <error>Error</error> 
</resultDescription>
 /esbEvent>
-----------------------------
Error:

The element 'esbEvent' in namespace 'http://BioArchR2_Email_Notifications_Pipeline.CustomerAck ' has invalid child element 'header' in namespace 'http://BioArchR2_Email_Notifications_Pipeline.CustomerAck '. List of possible elements expected: 'header'.

-----------------------------
Can anyone please help me with getting over this issue. I spent a day to see what is wrong and can't still figure out.
thanks in advance.





Similar Threads
Thread Thread Starter Forum Replies Last Post
error in xml validation with xsd schema. pavanibiji XML 3 December 6th, 2011 06:02 PM
namespace issue. xml and xsd jamesdurham XML 5 April 7th, 2009 07:13 PM
create xml with xsd validation obaxe3k XSLT 1 August 13th, 2008 09:43 AM
XML validation with XSD ksskumar XML 0 October 12th, 2007 04:46 AM
xml validation with xsd amolkad XML 0 June 24th, 2004 06:02 AM





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