Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
| Search | Today's Posts | Mark Forums Read
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
  #1 (permalink)  
Old August 20th, 2008, 04:33 AM
Authorized User
 
Join Date: Apr 2006
Location: london, , United Kingdom.
Posts: 19
Thanks: 3
Thanked 0 Times in 0 Posts
Send a message via MSN to akshay144
Default problem with xsi:SchemaLocation

I have a template XML file which has xsi:SchemaLocation and I also need another xsi:SchemaLocation somewhere else within the document.

CODE :-

elShowInvoice.SetAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance" );

elShowInvoice.SetAttribute("xsi:schemaLocation", "http://www.openapplications.org/oagis/9" + @"C:\OAGIS\9.0\BODs\Developer\ShowInvoice.xsd" );

[u]WHAT IT LOOKS LIKE:-</u>

<oat:transmission xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.yahoo.net/oagis/9 .\transmission.xsd" xmlns:oat="http://www.yahoo.net/oagis/9">
 <oat:header>7e118072-470c-42d4-9bf5-e783034d1517</oat:header>
 <oat:body>
  <oat:transaction>
   <oa:ShowInvoice xmlns:oa="http://www.openapplications.org/oagis/9" xmlns:ms="urn:schemas-microsoft-com:xslt" xmlns:user="urn:the-xml-files:xslt-csharp" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaLocation="http://www.openapplications.org/oagis/9C:\OAGIS\9.0\BODs\Developer\ShowInvoice.xsd"

[u]WHAT I WANT IT TO LOOK LIKE:-</u>

<oat:transmission xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.yahoo.net/oagis/9 .\transmission.xsd" xmlns:oat="http://www.yahoo.net/oagis/9">
 <oat:header>7e118072-470c-42d4-9bf5-e783034d1517</oat:header>
 <oat:body>
  <oat:transaction>
   <oa:ShowInvoice xmlns:oa="http://www.openapplications.org/oagis/9" xmlns:ms="urn:schemas-microsoft-com:xslt" xmlns:user="urn:the-xml-files:xslt-csharp" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openapplications.org/oagis/9C:\OAGIS\9.0\BODs\Developer\ShowInvoice.xsd"

Please help me.
  #2 (permalink)  
Old August 20th, 2008, 04:47 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

I suspect elsewhere in your document there will be a namespace attribute like this:

xmlns="http://www.w3.org/2001/XMLSchema-instance"

This means that xsi:schemaLocation and schemaLocation are equivalent.

if you must have control over the prefix you can try creating an XmlAttribute object and settings its Prefix property instead.



/- Sam Judson : Wrox Technical Editor -/
  #3 (permalink)  
Old August 20th, 2008, 05:40 AM
Authorized User
 
Join Date: Apr 2006
Location: london, , United Kingdom.
Posts: 19
Thanks: 3
Thanked 0 Times in 0 Posts
Send a message via MSN to akshay144
Default

Hi Sam

Thanks, I did that and it has sorted my problem.

Cheers
Akshay


Similar Threads
Thread Thread Starter Forum Replies Last Post
schemaLocation vs nonamespaceschema... newbieboobers XML 0 August 28th, 2008 11:30 AM
Creating xsi:type as an attribute AjayLuthria XSLT 5 May 10th, 2007 09:49 AM
missing schemalocation in output XML matrixman XSLT 7 May 4th, 2007 07:55 AM
validateOnParse versus xsi:nil JaKKe XML 0 March 7th, 2006 07:23 AM
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.