473,811 Members | 3,627 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Signed-signed xml-doc and xsd

Hi,
I´m a bit of a newbie when it comes to xml but here goes:

I am using the SignedXml-class to construct a signed xmldoc which in turn
contains 1 or more signed xml-doc which creates the following structure
(edited of course):

<Signature xmlns:xd="Whate ver">
<Object Id="A uri">
<Signature>
<Object Id="Another uri">My data</Object>
</Signature>
</Object>
</Signature>

My problem occurrs when try to use xsd.exe to create a schema for this. I
get the following error message:
- The table (Signature) cannot be the child table of itself in nested
relations

However if I remove the outer Object-tags (generated by SignedXml.AddOb ject)
it creates a schema without a problem.

1. Does anybody have a simple explanation for this?
2. Is there a way to remove the object tags and move the Id-attribute to the
next line (using XmlDocument,Sig nedXml or any other class)
3. I´m guessing that xsd.exe performs some sort of check if the xml is
valid. Is this xml considered to be valid?

Thanks in advance
Jon
Nov 12 '05 #1
6 1751
Jon,

1. Does anybody have a simple explanation for this?
XSD has problems with Xml formats where an element can be nested within
itself. In your case you have an <Object> element inside another <Object>
element.
2. Is there a way to remove the object tags and move the Id-attribute to
the
next line (using XmlDocument,Sig nedXml or any other class)
I am note quite sure what you are trying to accomplish. Can you explain?
3. I´m guessing that xsd.exe performs some sort of check if the xml is
valid. Is this xml considered to be valid?


Yes it is valid. It's only xsd.exe that doesn't like what you are doing.

Is the schema really as simple as you posted or is it rather complex and
creating it by hand is not really an option?

Also, have you tried the schema inference tool [0]?

HTH,
Christoph Schittko
[MVP XML .NET]

[0] http://apps.gotdotnet.com/xmltools/xsdinference/
Nov 12 '05 #2
Jon,

1. Does anybody have a simple explanation for this?
XSD has problems with Xml formats where an element can be nested within
itself. In your case you have an <Object> element inside another <Object>
element.
2. Is there a way to remove the object tags and move the Id-attribute to
the
next line (using XmlDocument,Sig nedXml or any other class)
I am note quite sure what you are trying to accomplish. Can you explain?
3. I´m guessing that xsd.exe performs some sort of check if the xml is
valid. Is this xml considered to be valid?


Yes it is valid. It's only xsd.exe that doesn't like what you are doing.

Is the schema really as simple as you posted or is it rather complex and
creating it by hand is not really an option?

Also, have you tried the schema inference tool [0]?

HTH,
Christoph Schittko
[MVP XML .NET]

[0] http://apps.gotdotnet.com/xmltools/xsdinference/
Nov 12 '05 #3
Thanks for your answer Christoph.

2. I found a page discussing SignedXml
(http://www.mcse.ms/archive105-2003-12-171469.html) where I found the
following info:

"Note, if the application wishes to exclude the <Object> tags from the
digest
calculation the Reference must identify the actual data object (easy for XML
documents) or a transform must be used to remove the Object tags (likely
where the data object is non-XML)"

Since the object-tags were the problem I just wanted to remove them from the
signature using the FCL and not editing the structure myself. But since I
now know that my xml is valid, this is not an issue anymore.

The schema is a bit more complex than the one that I posted (I simply
excluded everything that didn´t xsd.exe accepted), but I going to make an
attempt at creating it myself.

Thanks
-Jon
"Christoph Schittko [MVP]" <ch************ ********@austin .rr.com> skrev i
meddelandet news:um******** ******@TK2MSFTN GP10.phx.gbl...
Jon,

1. Does anybody have a simple explanation for this?


XSD has problems with Xml formats where an element can be nested within
itself. In your case you have an <Object> element inside another <Object>
element.
2. Is there a way to remove the object tags and move the Id-attribute to
the
next line (using XmlDocument,Sig nedXml or any other class)


I am note quite sure what you are trying to accomplish. Can you explain?
3. I´m guessing that xsd.exe performs some sort of check if the xml is
valid. Is this xml considered to be valid?


Yes it is valid. It's only xsd.exe that doesn't like what you are doing.

Is the schema really as simple as you posted or is it rather complex and
creating it by hand is not really an option?

Also, have you tried the schema inference tool [0]?

HTH,
Christoph Schittko
[MVP XML .NET]

[0] http://apps.gotdotnet.com/xmltools/xsdinference/

Nov 12 '05 #4
Thanks for your answer Christoph.

2. I found a page discussing SignedXml
(http://www.mcse.ms/archive105-2003-12-171469.html) where I found the
following info:

"Note, if the application wishes to exclude the <Object> tags from the
digest
calculation the Reference must identify the actual data object (easy for XML
documents) or a transform must be used to remove the Object tags (likely
where the data object is non-XML)"

Since the object-tags were the problem I just wanted to remove them from the
signature using the FCL and not editing the structure myself. But since I
now know that my xml is valid, this is not an issue anymore.

The schema is a bit more complex than the one that I posted (I simply
excluded everything that didn´t xsd.exe accepted), but I going to make an
attempt at creating it myself.

Thanks
-Jon
"Christoph Schittko [MVP]" <ch************ ********@austin .rr.com> skrev i
meddelandet news:um******** ******@TK2MSFTN GP10.phx.gbl...
Jon,

1. Does anybody have a simple explanation for this?


XSD has problems with Xml formats where an element can be nested within
itself. In your case you have an <Object> element inside another <Object>
element.
2. Is there a way to remove the object tags and move the Id-attribute to
the
next line (using XmlDocument,Sig nedXml or any other class)


I am note quite sure what you are trying to accomplish. Can you explain?
3. I´m guessing that xsd.exe performs some sort of check if the xml is
valid. Is this xml considered to be valid?


Yes it is valid. It's only xsd.exe that doesn't like what you are doing.

Is the schema really as simple as you posted or is it rather complex and
creating it by hand is not really an option?

Also, have you tried the schema inference tool [0]?

HTH,
Christoph Schittko
[MVP XML .NET]

[0] http://apps.gotdotnet.com/xmltools/xsdinference/

Nov 12 '05 #5
Jon,

I'm still not quite sure what you needed xsd.exe for, but it sounds like you
got your problem solved.

I hope I could help
--
Christoph Schittko [MVP]
Software Architect, .NET Mentor
"Jon G" <no****@nowhere .com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Thanks for your answer Christoph.

2. I found a page discussing SignedXml
(http://www.mcse.ms/archive105-2003-12-171469.html) where I found the
following info:

"Note, if the application wishes to exclude the <Object> tags from the
digest
calculation the Reference must identify the actual data object (easy for
XML
documents) or a transform must be used to remove the Object tags (likely
where the data object is non-XML)"

Since the object-tags were the problem I just wanted to remove them from
the
signature using the FCL and not editing the structure myself. But since I
now know that my xml is valid, this is not an issue anymore.

The schema is a bit more complex than the one that I posted (I simply
excluded everything that didn´t xsd.exe accepted), but I going to make an
attempt at creating it myself.

Thanks
-Jon
"Christoph Schittko [MVP]" <ch************ ********@austin .rr.com> skrev i
meddelandet news:um******** ******@TK2MSFTN GP10.phx.gbl...
Jon,
>
> 1. Does anybody have a simple explanation for this?


XSD has problems with Xml formats where an element can be nested within
itself. In your case you have an <Object> element inside another <Object>
element.
> 2. Is there a way to remove the object tags and move the Id-attribute
> to
> the
> next line (using XmlDocument,Sig nedXml or any other class)


I am note quite sure what you are trying to accomplish. Can you explain?
> 3. I´m guessing that xsd.exe performs some sort of check if the xml is
> valid. Is this xml considered to be valid?


Yes it is valid. It's only xsd.exe that doesn't like what you are doing.

Is the schema really as simple as you posted or is it rather complex and
creating it by hand is not really an option?

Also, have you tried the schema inference tool [0]?

HTH,
Christoph Schittko
[MVP XML .NET]

[0] http://apps.gotdotnet.com/xmltools/xsdinference/


Nov 12 '05 #6
Jon,

I'm still not quite sure what you needed xsd.exe for, but it sounds like you
got your problem solved.

I hope I could help
--
Christoph Schittko [MVP]
Software Architect, .NET Mentor
"Jon G" <no****@nowhere .com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Thanks for your answer Christoph.

2. I found a page discussing SignedXml
(http://www.mcse.ms/archive105-2003-12-171469.html) where I found the
following info:

"Note, if the application wishes to exclude the <Object> tags from the
digest
calculation the Reference must identify the actual data object (easy for
XML
documents) or a transform must be used to remove the Object tags (likely
where the data object is non-XML)"

Since the object-tags were the problem I just wanted to remove them from
the
signature using the FCL and not editing the structure myself. But since I
now know that my xml is valid, this is not an issue anymore.

The schema is a bit more complex than the one that I posted (I simply
excluded everything that didn´t xsd.exe accepted), but I going to make an
attempt at creating it myself.

Thanks
-Jon
"Christoph Schittko [MVP]" <ch************ ********@austin .rr.com> skrev i
meddelandet news:um******** ******@TK2MSFTN GP10.phx.gbl...
Jon,
>
> 1. Does anybody have a simple explanation for this?


XSD has problems with Xml formats where an element can be nested within
itself. In your case you have an <Object> element inside another <Object>
element.
> 2. Is there a way to remove the object tags and move the Id-attribute
> to
> the
> next line (using XmlDocument,Sig nedXml or any other class)


I am note quite sure what you are trying to accomplish. Can you explain?
> 3. I´m guessing that xsd.exe performs some sort of check if the xml is
> valid. Is this xml considered to be valid?


Yes it is valid. It's only xsd.exe that doesn't like what you are doing.

Is the schema really as simple as you posted or is it rather complex and
creating it by hand is not really an option?

Also, have you tried the schema inference tool [0]?

HTH,
Christoph Schittko
[MVP XML .NET]

[0] http://apps.gotdotnet.com/xmltools/xsdinference/


Nov 12 '05 #7

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

Similar topics

4
6889
by: Ang Talunin | last post by:
Hey, I'm trying to read an xml from another webpage with: xmlDoc.load("http://www.otherwebsite.com/test.xml"); But this doesn't work...anybody knows a way to fix this? thnx, A.T.
1
1627
by: Leonid | last post by:
we are using : var xmlfileLoaded = xmlDoc.load(xmlFileName); and we noticed that this files are not cached in numbers of clients Internet Exporer v6. We see in httprequest log this request. We also tried to gzip the request but probably xmlDoc not allowed it.
2
9082
by: Steve Gilbey | last post by:
I have a dataset from which I need to extract certain columns, format them into xml and output to an xmldocument object. From reading various posts on similar subjects, I have come up with the following test code (using 2 constants, rather than my dataset values): Public Sub test() Dim doc As New XmlDocument Dim xmlStream As Stream = New MemoryStream
0
1297
by: rene.rugerio[at]gmail.com | last post by:
hi forum dumb question here i have this xmldocument which is from a certain xml looping in the nodes i can see which if the attributes are empty the thing here is that i just dont know how to erase the ones aren't filled they appear like <node att1="" att2="yes" att3="ok" att4=""> i want to take att1 and att4 out, any ideas ?
0
1023
by: MFRASER | last post by:
I am trying to create a csv inner text inside of an XML file. The file I am trying to process has a lot of data, but I seem to get a memory error on the inner text. Is there a limit to the inner text size? example of XML <TestCSV "COLUMNS=field1,field2,field3"> 1,2,3 4,5,6... <TestCSV
4
5170
by: James Geurts | last post by:
Hi, I have a schema file defining objects. I then use xsd to convert that schema into a C# class file. Is it possible to have xmldoc comments added to the generated c# file? I have attempted to add <xsd:annotation><xsd:documentation /> tags to various parts of the schema, but that does not appear to do anything. Thanks Jim
9
1705
by: M.Siler | last post by:
It is my understanding that XMLdoc only works for C#. I'd be glad to pay for a commercial product, but I want to make sure it is a good one, so I thought I'd ask here if anyone is using a product that works like XMLdoc does for C# for VB.
1
2922
by: skastro | last post by:
Im having problems with the xmldoc returned by XMLHttpRequest.responseXML. alert( xmldoc.getElementsByTagName('element').firstChild.nodeValue.length ); if the text is bigger than 4096 bytes, then the value returned is only 4096
2
2307
by: KingdomHeart | last post by:
I recently write code to get IP address of my network devices in Call Manager. ANd I got problems with xmlhttp and xmldoc. what is wrong with these 2 lines below? xmlhttp.Send(); xmlDoc.loadXML(xmlhttp.responseText); here is the function getDeviceList function getDeviceList(callManager, userID, password, protocol) {
2
2599
by: MimiMi | last post by:
I'm completely new to xml-manipulation in C#. I have an XmlDocument (xmldoc) and want to add a new element (node) to the xmldoc.DocumentElement.ChildNodes. How do I achieve that? Thanks!
0
9605
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10403
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10136
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7671
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6893
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5555
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5693
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4341
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3868
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.