473,387 Members | 1,486 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Not recognizing namespace prefix

I have a schema that I'm trying to read. The schema has an element named
'GrantApplication' and one with a namespace prefix named
'SF424:GrantApplication'. When I try to read this schema in, I get an
exception saying 'A datatable named 'GrantApplication' alread belongs to this
dataset'. Why is dotnet not recognizing the namespace prefix and treating
these like two separate elements?

Thanks for your help.
Nov 12 '05 #1
2 1986
"Dale Anderson" <Dale An******@discussions.microsoft.com> wrote in message
news:CB**********************************@microsof t.com...
The schema has an element named
'GrantApplication' and one with a namespace prefix named
'SF424:GrantApplication'. When I try to read this schema in, I get an
exception saying 'A datatable named 'GrantApplication' alread belongs to this
dataset'.


The first thing I'd check is the namespace URIs to see if they're really the same.

Remember that if you have a default namespace URI in effect, like urn:my-types,
and then have an xmlns declaration associating the prefix, SF424, with the same
namespace URI, urn:my-types, then the two references to GrantApplication are
identical.
Derek Harmon
Nov 12 '05 #2
Hi Derek,

Thanks for the response. Below is a listing of the schema. The problem is
that I have to write a program that generates an XML file that conforms to
this schema. I cannot make changes to it, because it was developed by
someone else. If there is something wrong with the schema I can notify them
and hope that they will make the change. But, I suspect that the schema is
ok because other people are using it.

Thanks again for your response.

<?xml version="1.0"?>
<xsd:schema
targetNamespace="http://apply.grants.gov/system/MetaGrantApplication"
xmlns:grant="http://apply.grants.gov/system/MetaGrantApplication"
xmlns:header="http://apply.grants.gov/system/Header-V1.0"
xmlns:footer="http://apply.grants.gov/system/Footer-V1.0"
xmlns:att="http://apply.grants.gov/system/Attachments-V1.0"
xmlns:SF424="http://apply.grants.gov/forms/SF424-V1.0"
xmlns:SF424B="http://apply.grants.gov/forms/SF424B-V1.0"
xmlns:SF424A="http://apply.grants.gov/forms/SF424A-V1.0"
xmlns:SFLLL="http://apply.grants.gov/forms/SFLLL-V1.0"
xmlns:SF424D="http://apply.grants.gov/forms/SF424D-V1.0"
xmlns:SF424C="http://apply.grants.gov/forms/SF424C-V1.0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="qualified">

<!--System Data Types-->
<xsd:import namespace="http://apply.grants.gov/system/Header-V1.0"
schemaLocation="http://apply.grants.gov/system/schemas/Header-V1.0.xsd"/>
<xsd:import namespace="http://apply.grants.gov/system/Footer-V1.0"
schemaLocation="http://apply.grants.gov/system/schemas/Footer-V1.0.xsd"/>
<xsd:import namespace="http://apply.grants.gov/system/Attachments-V1.0"
schemaLocation="http://apply.grants.gov/system/schemas/Attachments-V1.0.xsd"/>

<!--Included Mandatory Forms-->
<xsd:import namespace="http://apply.grants.gov/forms/SF424-V1.0"
schemaLocation="http://apply.grants.gov/forms/schemas/SF424-V1.0.xsd"/>
<xsd:import namespace="http://apply.grants.gov/forms/SF424B-V1.0"
schemaLocation="http://apply.grants.gov/forms/schemas/SF424B-V1.0.xsd"/>
<xsd:import namespace="http://apply.grants.gov/forms/SF424A-V1.0"
schemaLocation="http://apply.grants.gov/forms/schemas/SF424A-V1.0.xsd"/>

<!--Included Optional Forms-->
<xsd:import namespace="http://apply.grants.gov/forms/SFLLL-V1.0"
schemaLocation="http://apply.grants.gov/forms/schemas/SFLLL-V1.0.xsd"/>
<xsd:import namespace="http://apply.grants.gov/forms/SF424D-V1.0"
schemaLocation="http://apply.grants.gov/forms/schemas/SF424D-V1.0.xsd"/>
<xsd:import namespace="http://apply.grants.gov/forms/SF424C-V1.0"
schemaLocation="http://apply.grants.gov/forms/schemas/SF424C-V1.0.xsd"/>

<xsd:element name="GrantApplication">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="header:GrantSubmissionHeader"/>
<xsd:element name="Forms">
<xsd:complexType>
<xsd:all>

<!--Included Mandatory Forms-->
<xsd:element ref="SF424:GrantApplication"/>
<xsd:element ref="SF424B:Assurances"/>
<xsd:element ref="SF424A:BudgetInformation"/>

<!--Included Optional Forms-->
<xsd:element ref="SFLLL:LobbyingActivitiesDisclosure" minOccurs="0"/>
<xsd:element ref="SF424D:Assurances" minOccurs="0"/>
<xsd:element ref="SF424C:BudgetInformation" minOccurs="0"/>
</xsd:all>
</xsd:complexType>
</xsd:element>
<xsd:element ref="footer:GrantSubmissionFooter"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
"Derek Harmon" wrote:
"Dale Anderson" <Dale An******@discussions.microsoft.com> wrote in message
news:CB**********************************@microsof t.com...
The schema has an element named
'GrantApplication' and one with a namespace prefix named
'SF424:GrantApplication'. When I try to read this schema in, I get an
exception saying 'A datatable named 'GrantApplication' alread belongs to this
dataset'.


The first thing I'd check is the namespace URIs to see if they're really the same.

Remember that if you have a default namespace URI in effect, like urn:my-types,
and then have an xmlns declaration associating the prefix, SF424, with the same
namespace URI, urn:my-types, then the two references to GrantApplication are
identical.
Derek Harmon

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: John L. Clark | last post by:
I am curious as to the rationale, and effect, of having default namespaces not applying (directly) to attributes (see http://www.w3.org/TR/REC-xml-names/#defaulting). Given an attribute without a...
25
by: kj | last post by:
Consider the following XML document: <?xml version='1.0' encoding='UTF-8'?> <bar:foo xmlns:bar='someuri'> <baz/> </bar:foo> What namespace does baz belong to? What is this namespace bound...
3
by: Mike Dickens | last post by:
hi, i'm sure this has come up before but havn't managed to find an answer. if i have the following xslt <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet method="xml" version="1.0"...
4
by: Krishna Tulasi via .NET 247 | last post by:
Hi, I am having trouble with creation of XML programmatically using .NET. Specifically Im trying to create an element which looks like below and insert into an existing xml doc: <Worksheet...
5
by: pneumoconi | last post by:
I've read a lot of posts on this subject each with a slightly different issue and from what I gather my code is fine. But its not. I'm trying to pull out the SQL query from a SQL report document...
5
by: David Thielen | last post by:
Hi; I set up my xml as follows: XmlDocument xml = new XmlDocument(); xml.Load(File.Open("data.xml", FileMode.Open, FileAccess.Read)); XmlNamespaceManager context = new...
18
by: jacksu | last post by:
I have a simple program to run xpath with xerces 1_2_7 XPathFactory factory = XPathFactory.newInstance(); XPath xPath = factory.newXPath(); XPathExpression xp = xPath.compile(strXpr);...
13
by: Axel Dahmen | last post by:
Hi, I've got a question on namespaces. After reading http://www.w3.org/TR/xml-names11 I still don't understand how namespaces are applied to attributes - particularly in regard to how processing...
2
by: scottpet | last post by:
Hi, I want to add a namespace prefix to the root node of an object I am serializing to XML. I have been reading though this article:...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.