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 June 20th, 2009, 03:48 AM
Authorized User
 
Join Date: Apr 2009
Posts: 25
Thanks: 5
Thanked 0 Times in 0 Posts
Default how to refer any schema attribute in one file while it is declared in other

Hi,

I need to validate some extra nodes and attributes against schema files. I can't declare those attributes in existing schema files but need to create separate ones and need to refer those declarations in already existing schemas.

Eg.

<Source PseudoCityCode="NPCK" TerminalID="1">
<RequestorID ID="YT"/>
</Source>


Now, all the attributes are validated except @TerminalID.
I have declared this attribute in a separate xsd as :

<xs:complexType>
<xs:sequence>
<xs:element name="YT_SourceType">
<xs:complexType>
<xs:attribute name="TerminalID" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:complexType>


I need to refer this in my existing schema file, which has code like :

<xs:complexType name="SourceType">
<xs:sequence>
<xs:element name="RequestorID" type="UniqueID_Type"/>
<xs:attribute name="PseudoCityCode" type="xs:string" use="optional"/>
</xs:sequence>
</xs:complexType>


I have already included my schema file in this file as:

<xs:include schemaLocation="CustomizedRQ.xsd"/>

Please help me how to do this.

Regards,
Mary
 
Old June 20th, 2009, 10:39 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

I suspect you can achieve what you want using xs:redefine. It's not a facility I recommend to people, because I think it causes confusion, but it seems to do what you are looking for.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old June 21st, 2009, 01:18 PM
Authorized User
 
Join Date: Apr 2009
Posts: 25
Thanks: 5
Thanked 0 Times in 0 Posts
Default

ok...thanks....i will try this and come back in case of any problem





Similar Threads
Thread Thread Starter Forum Replies Last Post
'attribute is not declared' error jihadbuster XSLT 6 April 2nd, 2008 01:20 PM
Soap Error : Attribute xmlns must be declared RatanKumar XML 0 December 4th, 2006 08:07 PM
Save database schema to XML file brettk_1 General .NET 2 September 16th, 2006 04:27 AM
Need help with my Flat File Schema cmiller66 Biztalk 0 August 21st, 2006 10:48 PM
Schema and Data in the same file, check possible? lpinho XML 0 December 4th, 2003 07:29 AM





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