|
You already got an answer for this question in the C# forum (answer[^]). Instead of simply reposting the question in another forum, you should try to understand what you were told in the answer and work with that info.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hello,
First I'll state that I put this question on the XML section of the forum at www.asp.net and have not been able to get one response, perhaps someone here has run into this.
I currently have an instance XML document that validates cleanly against an XSD file. That XSD has 2 <import> tags referencing other component XSD files. All of the files are located in the same directory. The declaration and imports in the "parent" schema look like this:
<xsd:schema targetNamespace="http://www.xyz.com/ConnectResponse" xmlns:arf="http://www.xyz.com/ARFResponse" xmlns:cpu="http://www.xyz.com/CPUResponse" xmlns="http://www.xyz.com/ConnectResponse" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="2.401">
<xsd:import namespace="http://www.xyz.com/ARFResponse" schemaLocation="ARFXMLResponse.xsd"/>
<xsd:import namespace="http://www.xyz.com/CPUResponse" schemaLocation="BISXMLResponse.xsd"/>
The first imported schema declaration looks like this:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.xyz.com/ARFResponse" targetNamespace="http://www.xyz.com/ARFResponse" elementFormDefault="qualified" attributeFormDefault="unqualified" version="2.5">
The second imported schema declaration looks like this:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.xyz.com/CPUResponse" targetNamespace="http://www.xyz.com/CPUResponse" elementFormDefault="qualified" attributeFormDefault="unqualified" version="2.301">
When I run the xsd.exe tool on the "parent" schema: xsd.exe -c -l:c# -n:XMLSerializationTest ConnectResponse.xsd
I get nothing but errors....yet the instance of the actual XML document validates perfectly w/ the 3 schemas.
Microsoft (R) Xml Schemas/DataTypes support utility
[Microsoft (R) .NET Framework, Version 2.0.50727.42]
Copyright (C) Microsoft Corporation. All rights reserved.
Schema validation warning: The 'http://www.xyz.com/ARFResponse:Products' el
ement is not declared. Line 12, position 7.
Schema validation warning: The 'http://www.xyz.com/CPUResponse:Products' el
ement is not declared. Line 13, position 7.
Warning: Schema could not be validated. Class generation may fail or may produce
incorrect results.
Error: Error generating classes for schema 'ConnectResponse'.
- The element 'http://www.xyz.com/ARFResponse:Products' is missing.
Is there some limitation to using this tool when multiple XSDs comprise a set for validation purposes - ie: parent schema w/ component schemas linked using either the <import> or <include>?
One last thing...I tried to reverse the process. I used xsd.exe on the instance XML itself to have it generate the XSD file. It generated 2 XSD files (one w/ an import). Then I tried to run the process again on the parent XSD that xsd.exe itself created...and again, nothing but errors and failure to generate any classes.
Any ideas would really be appreciated...this has been more than frustrating.
Thanks in advance...
|
|
|
|
|
Hey there people, I genereate xml from the datatables, but i need to group and structure the xml more correctly. could you please assist me in this matter. Here is the code what i am doing,
select
1 AS Tag,
NULL AS Parent,
NULL AS 'FORMSETXML!1!FORMSETXML',
NULL AS 'FORMSET!2!FORMSET',
NULL AS 'FORMSET!2!FRM_SET_CDE',
NULL AS 'FORMSET!2!SYS_LNG_CDE',
NULL AS 'FORMSET!2!FRM_SET_TYP',
NULL AS 'FORMSET!2!FRM_SET_CPT',
NULL AS 'FORMSET!2!EXT_STP_NME',
NULL AS 'FORMSET!2!TIMESTAMP',
NULL AS 'FORMSETDEFINITION!3!FORMSETDEFINITION',
NULL AS 'FORMSETDEFINITION!3!ENTITY',
NULL AS 'FORMSETDEFINITION!3!CTL_IDN',
NULL AS 'FORMSETATTRIBUTE!4!FORMSETATTRIBUTE',
NULL AS 'FORMSETATTRIBUTE!4!ATR_FRY_NME'
UNION ALL
SELECT
2 AS Tag,
1 AS Parent,
null,
frm_set.frm_set_cde,
frm_set.frm_set_cde,
frm_set.sys_lng_cde,
frm_set.frm_set_typ_cde,
frm_set.frm_set_cpt,
'TEST STORED PROC',
GETDATE(),
null,
frm_set_def.ent_cde,
frm_set_def.ctl_idn,
null,
frm_set_atr.atr_fry_nme
FROM mda_form_set frm_set
INNER JOIN mda_form_set_definition frm_set_def ON (frm_set.frm_set_cde = frm_set_def.frm_set_cde and frm_set.sys_lng_cde = frm_set_def.sys_lng_cde)
INNER JOIN mda_attribute frm_set_atr ON (frm_set_def.ent_cde = frm_set_atr.ent_cde and frm_set_def.atr_cde = frm_set_atr.atr_cde)
UNION ALL
SELECT
3 AS Tag,
2 AS Parent,
null,
frm_set.frm_set_cde,
frm_set.frm_set_cde,
frm_set.sys_lng_cde,
frm_set.frm_set_typ_cde,
frm_set.frm_set_cpt,
'TEST STORED PROC',
GETDATE(),
null,
frm_set_def.ent_cde,
frm_set_def.ctl_idn,
null,
frm_set_atr.atr_fry_nme
FROM mda_form_set_definition frm_set_def
INNER JOIN mda_form_set frm_set ON (frm_set.frm_set_cde = frm_set_def.frm_set_cde and frm_set.sys_lng_cde = frm_set_def.sys_lng_cde)
INNER JOIN mda_attribute frm_set_atr ON (frm_set_def.ent_cde = frm_set_atr.ent_cde and frm_set_def.atr_cde = frm_set_atr.atr_cde)
UNION ALL
SELECT
4 AS Tag,
3 AS Parent,
null,
frm_set.frm_set_cde,
frm_set.frm_set_cde,
frm_set.sys_lng_cde,
frm_set.frm_set_typ_cde,
frm_set.frm_set_cpt,
'TEST STORED PROC',
GETDATE(),
null,
frm_set_def.ent_cde,
frm_set_def.ctl_idn,
null,
frm_set_atr.atr_fry_nme
FROM mda_attribute frm_set_atr
INNER JOIN mda_form_set_definition frm_set_def ON (frm_set_def.ent_cde = frm_set_atr.ent_cde and frm_set_def.atr_cde = frm_set_atr.atr_cde)
INNER JOIN mda_form_set frm_set ON (frm_set.frm_set_cde = frm_set_def.frm_set_cde and frm_set.sys_lng_cde = frm_set_def.sys_lng_cde)
ORDER BY 'FORMSETATTRIBUTE!4!ATR_FRY_NME', 'FORMSETDEFINITION!3!CTL_IDN', 'FORMSET!2!FRM_SET_CDE',parent
FOR XML EXPLICIT
/*
Now let me give you a sample of the xml output i retrieve
*/
<formsetxml>
<formset formset="1" frm_set_cde="1" sys_lng_cde="AFR" frm_set_typ="Grid" frm_set_cpt="1" ext_stp_nme="TEST STORED PROC" timestamp="2007-08-15T10:11:22.747">
<formsetdefinition entity="spl_master" ctl_idn="cmp_trd_nmelabel3">
<formsetattribute atr_fry_nme="Comapny Trading Name:">
<formset formset="1" frm_set_cde="1" sys_lng_cde="AFR" frm_set_typ="Grid" frm_set_cpt="1" ext_stp_nme="TEST STORED PROC" timestamp="2007-08-15T10:11:22.747">
<formsetdefinition entity="spl_master" ctl_idn="cmp_trd_nmetextbox3">
<formsetattribute atr_fry_nme="Comapny Trading Name:">
<formset formset="1" frm_set_cde="1" sys_lng_cde="AFR" frm_set_typ="Grid" frm_set_cpt="1" ext_stp_nme="TEST STORED PROC" timestamp="2007-08-15T10:11:22.747">
<formsetdefinition entity="spl_master" ctl_idn="hld_cmplabel6">
<formsetattribute atr_fry_nme="Holding Company:">
<formset formset="1" frm_set_cde="1" sys_lng_cde="AFR" frm_set_typ="Grid" frm_set_cpt="1" ext_stp_nme="TEST STORED PROC" timestamp="2007-08-15T10:11:22.747">
<formsetdefinition entity="spl_master" ctl_idn="hld_cmptextbox6">
<formsetattribute atr_fry_nme="Holding Company:">
However, i would like the output to be like the following,
<formsetxml>
<formset formset="1" frm_set_cde="1" sys_lng_cde="AFR" frm_set_typ="Grid" frm_set_cpt="1" ext_stp_nme="TEST STORED PROC" timestamp="2007-08-15T10:11:22.747">
<formsetdefinition entity="spl_master" ctl_idn="cmp_trd_nmelabel3">
<formsetattribute atr_fry_nme="Comapny Trading Name:">
<formsetdefinition entity="spl_master" ctl_idn="cmp_trd_nmetextbox3">
<formsetattribute atr_fry_nme="Comapny Trading Name:">
<formsetdefinition entity="spl_master" ctl_idn="hld_cmplabel6">
<formsetattribute atr_fry_nme="Holding Company:">
<formsetdefinition entity="spl_master" ctl_idn="hld_cmptextbox6">
<formsetattribute atr_fry_nme="Holding Company:">
Please note that there are cases where there might be many '<formsetattribute>'s for a specific formset definition where this must then also happen
<formsetdefinition entity="spl_master" ctl_idn="cmp_trd_nmetextbox3">
<formsetattribute atr_fry_nme="Comapny Trading Name1:">
<formsetattribute atr_fry_nme="Comapny Trading Name2:">
Help will be greatly appreciated. Thanks
|
|
|
|
|
I am trying to convert Excel to XML.
For that I have done the 1st step of saving Excel to the dataset dsSource.
Now I am trying to convert data from the dataset dsSource to XML document and I am having problems doing that. I get an error "the name 'dsSource' does not exist in the current context"
#region private dsSource GetXml()
string Xml = dsSource.GetXml().ToString;
#endregion
Any suggestions??
|
|
|
|
|
Hi,
I have a following client side code
how to upload xml file to server programatically.
// files upload function
function btn_send.onclick()
{
// create ADO-stream Object
var ado_stream = new ActiveXObject("ADODB.Stream");
// create XML document with default header and primary node
var xml_dom = new ActiveXObject("MSXML2.DOMDocument");
xml_dom.loadXML(' ');
// specify namespaces datatypes
xml_dom.documentElement.setAttribute("xmlns:dt", "urn:schemas-microsoft-com:datatypes");
// create a new node and set binary content
var l_node1 = xml_dom.createElement("file1");
l_node1.dataType = "bin.base64";
// open stream object and read source file
ado_stream.Type = 1; // 1=adTypeBinary
ado_stream.Open();
ado_stream.LoadFromFile("c:\\tmp\\myfile.doc");
// store file content into XML node
l_node1.nodeTypedValue = ado_stream.Read(-1); // -1=adReadAll
ado_stream.Close();
xml_dom.documentElement.appendChild(l_node1);
// we can create more XML nodes for multiple file upload
// send XML documento to Web server
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("POST","./default.aspx",false);
xmlhttp.send(xml_dom);
// show server message in message-area
div_message.innerHTML = xmlhttp.ResponseText;
}
|
|
|
|
|
I have the following requirement for an assignment. Could u please help me in creating xml document for this. I have images stored in c drive.
. Create an xml document that models the image groups. Each grouping should include the name and location of the images within the group.
• Create a web page that allows the user to select and display a group of images.
• Use the xml file to specify the groups of images the user can select.
• Allow the user to select a group of images.
• Display the group of images when a selection is made.
seema
|
|
|
|
|
I think you should try to be a lot more specific that thsi if you wanna get some kind of a response... People are not free enuff to just solve out your whole assignments. you should tell us what progress you've made and what's the problem your getting or atmost asking for a little conceptual help!
Hope u got my point.
Thanks
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
I have three image groups. I have to create an XML document that models the image groups.Each grouping should include the name and location of the images within the group.
How can I do that.
Thanks
seema
|
|
|
|
|
Try the XMLTextWriter Class
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
Hi All
I have a Database in Access 200, and i need to send it to SQl, with DTS, So the Data can be tranfered, but now am going to use it in an Adapter. am using VB.net, so i need to have a Primary key if i want to update the Dataset. and the data is Already in MsAccess table. i will to Add an Identity column.
please Help
Vuyiswa Maseko
|
|
|
|
|
So what is your issue, and how is it related to XML/XSL?
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Hi ,
Iam new XSLT i need help from u . I have one column that has to split into 3 rows after that i need to convert into EXCel sheet,
howi can write in XSLT for this.
Please any one help in this,
aaa www 3
4
5
like this in excel sheet
|
|
|
|
|
What is the document type and the formatting of the column. You are very sparse with the details.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Hi, I have a table that potentially will span across multiple pages. The table has a border around it, however, when it flows onto the next page, only the left and right boreders show. Is there a way that I can get it to show the top and bottom borders when it spans multiple pages?
So on the first page it has the top, left and right. The last page will have left, right and bottom. The second page just has left and right borders. So obviously I am trying to get the bottom and top borders to display always. Note though, that individual rows do not have borders.
Thanks in advance.
|
|
|
|
|
Browsers don't have the print formatting capabilities to do that. You can only simulate it by creating multiple tables that approx. fit a printed paged. However, each model of priner may print your simulated formatting differently.
George
-- modified at 5:59 Tuesday 14th August, 2007
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
i want to remove all "Blah" nodes where the attribute "Foo" starts with value "Bar"
:
<doc>
...
<Blah Foo="Barf">
.... delete this node
</Blah>
<Blah Foo="Goo">
.... don't delete this node
</Blah>
<Beep Foo="Bar">
.... don't delete this node
</Beep>
....
</doc>
i'm sure this is a trivial extension of the basic identity template, but i just can't figure this out.
-- modified at 22:18 Friday 10th August, 2007
nevermind:
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select"@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="Blah[starts-with(@Foo, 'Bar')]" />
|
|
|
|
|
Please Help me in solving this problem...
I have two xml files
First File
<root>
<elm id="1">
<elm id="2">
<elm id="3">
</root>
Second File
<root>
<EL id="1">
<EL id="2">
</root>
now i want filter the first file elements based on Second file attribute, means i want to compare second file attribute and first file attribute in XSLT
|
|
|
|
|
In order to get the second document into the XSLT process, you can pass the second document via a parameter from a source such as C# or VB.NET or you can load the second document via the XSLT "document" function. The you will have to write XSLT code to address your problem.
-- modified at 15:28 Thursday 16th August, 2007
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Hi,
I have a question on XSLT.
I want to write a application with XSLT and ASP.NET. I want to introduce localization for the data which is transferred using XSL.
For example i have some data.I am formatting it using xslt and putting it in a div tag of ASP.NET page. How to licalise this data??
Also using XmlHttpObject i am contacting a server aspx page and which interns transfers data using xsl and returns back to javascript. But when a get response.text all asp controls visible in text, but when i put this text to div.innerHTML asp controls are not visible.. Hwto solve this??? Pls mail me the answers if u know... ravikanth143@gmail.com
Thanks and Regards,
Gore
|
|
|
|
|
i have a xml file as follows....
<?xml version="1.0" encoding="UTF-8" ?>
<response>
<result resultCount="1" resultsPerPage="25" pageNumber="1">
<performer id="1234">
<image ref="performer" height="404" width="590" url="http://aa.bb.com/items/imageCatalog/0/0/30000/7000/800/0/37808.jpg" />
<name>
<![CDATA[ abc xyz]]>
</name>
<home>
<![CDATA[ ]]>
</home>
<dateAdded>
<![CDATA[ 2007-08-02]]>
</dateAdded>
</performer>
</result>
<msgs>
<msg type="success" />
</msgs>
</response>
now i need to get the attribute "id" value "1234" which is in "performer" by using ASP classic code. please any one help me pleaseeeeeeeeeeeeeee....
Pradeep Reddy
-- modified at 3:19 Friday 10th August, 2007
|
|
|
|
|
pradeep kumarappagari wrote: by using ASP classic code
Research MSXML. It is a COM Library that implements XML DOM and is accessible from ASP when properly installed on the machine.
|
|
|
|
|
for C#
FileStream fs = new FileStream(filepath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load(fs);
XmlNodeList xmlnode = xmldoc.GetElementsByTagName("result");
string id = xmlnode[0].Attributes[0].Value;
hope this will work
Becoming Programmer...
|
|
|
|
|
Hello All,
Can someone tell me the limits of XML. What types of data is it suitable for?
Or what types of situations(other that web applications) is it used for?
I'm wondering in particular is it is used within the scientific community?
Thanks...
|
|
|
|
|
Ylno wrote: Can someone tell me the limits of XML.
You can't drink it or smoke it
Ylno wrote: What types of data is it suitable for?
Your type
Ylno wrote: Or what types of situations(other that web applications) is it used for?
Software situations
Ylno wrote: I'm wondering in particular is it is used within the scientific community?
Yes.... at least I would guess it is.
|
|
|
|
|
Cheers Mike,
Very useful.
|
|
|
|
|