|
|
Hi,
i'm using VS.net 2003 with .NET Framework 1.1. I'd like to use signedXML in the Namespace System.Security.Cryptography.XML. But when i'm trying to include (with "using") the namespace in C#, the only namespace VS.net displays under System.Security.Cryptography is X509Certificates.
Where is the XML Namespace?
Can someone please help me and tell me how to solve this problem?
Thanks
Obi
|
|
|
|
|
You have to reference the System.Security assembly that contains the classes in the System.Security.Cryptography.Xml namespace. Just like in C/C++ you can't call a function without it being linked to the DLL in which the function is defined.
Also, you may want to take a look at the article I finished writing a while back at http://www.codeproject.com/dotnet/xmldsiglic.asp[^]. You may find it helpful.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hey thanks a lot! I'm just a starter in C# and was not aware where to reference to dll's.
It solved my problem. Thanks again
|
|
|
|
|
how to serialize/deserialize derived class between two application? here is the situation:
class container
{
BaseClass bc;
}
class BaseClass
{..}
class DerivedClass1:BaseClass
{...}
class DerivedClass2:BaseClass
{...}
------------------------------------------
the "bc" in the container can be assigned to be DerivedClass1 or DerivedClass2. Those classes and serialize/deserialize functions will be use between two applications (App1, App2). App1 serialize "container", App2 try to deserialize "container".
I tried following ways:
1. Binaryformatter/Soapformatter: During the serialization, App1's name will also be serialized. When App2 try to deserialize, it can not find App1 and generate exceptions.
2. XmlSerializer: it can not serialize when "bc" is assgined to a class other than BaseClass
Any guru have any good method to handle this situation?
Thanks,
Leo
|
|
|
|
|
Hi Folks,
I am trying to start a project to describe my country as an XML file.
I have made a start at http://www.latedecember.com[^]
Also have an XSL underway - not online yet.
I am fairly new to XML so any feedback or ideas would be greatly appreciated. If anyone wants to join in with a .xml for your country please get in touch.
Davy
My Personal Blog - Homepage. Scottish News - Angus Blog, Perth Blog and Dundee Blog
|
|
|
|
|
Maybe this is just personal preference, but I cringe when I see this:
<cities>
<city>
<name>Aberdeen</name>
</city>
<city>
<name>Dundee</name>
</city>
</cities>
All those nested tags are really hard to read (and make for more complex parsing code). I would write it as:
<cities>
<city name='Aberdeen' />
<city name='Dundee' />
</cities> Free-form and/or long text descriptions can go in their own tags, such as country/filemeta/about or country/history/event/summary
But I like your idea, if enough folks join in, the result could be an encyclopedia in XML.
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
CP SearchBar v2.0.2 released
|
|
|
|
|
Thanks Mike - your input is very helpful. I was thinking that I was not taking advantage of attributes. Once I get a sample XSL online (important for people to see a sample output), I'll look again at the structure.
Michael Dunn wrote:
if enough folks join in, the result could be an encyclopedia in XML.
Yeah it has potential - the format and XSL is for any country so it would be nice to cover more that Scotland.
Davy
My Personal Blog - Homepage. Scottish News - Angus Blog, Perth Blog and Dundee Blog
|
|
|
|
|
I've just posted a couple of additions for you (SMG newspapers).
Have you thought about how you'll deal with aggregating data if you get a lot of submissions?
|
|
|
|
|
Thanks Niall - I have added your contributions.
Niall Barr wrote:
Have you thought about how you'll deal with aggregating data if you get a lot of submissions?
No not yet! Currently I am working on trying to build a Yahoo Group for the project and get a sample XSL together to showcase the data. The XML file needs some work - for example attributes are hardly used and could cut down number of tags.
Thanks for the interest!
Take care,
Davy
My Personal Blog - Homepage. Scottish News - Angus Blog, Perth Blog and Dundee Blog
|
|
|
|
|
Maybe a good start would be to define an extensible schema and to collect ideas for that schema (such as Mike Dunn's above). This could be a very useful thing, but publishing a schema will make it acceptable for many uses, so long as it is capable of handling many possibilities, and even allows for extension for the possibilities that are too rare to build-in, or ones that you or the community can't think of.
Also, and this *could* go along with the schema, using a namespace with namespace-qualified elements (perhaps even qualified attributes, like RDF requires), makes XML parsing easier since your elements would be qualified and couldn't get confused with other elements (by the XML parser that understands namespaces in most cases).
I think this is a really interesting idea. Good luck!
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi,
I'm trying to use MSXML3 to read a XML document and populate a CTreeCtrl in MFC. But to populate the tree I have to go through the xml document as the tree structure would be different from the xml hierarchy. Someone asked me to use xml patterns for this. Can anybody supply me with some tutorial/sample code for xml pattern support of MSXML? also, I was wondering if I can use xml path for this? I don't have any idea about xml pattern or, xml path. so I'm looking for as much help as I can get on them. Please supply any code in C++ only
Thanks,
|
|
|
|
|
Does anyone know of a good beautifier for XML that works with Visual Studio? Unfortunately, for now I am stuck with Visual C++ 6.0, but I would like to use it to edit XML, and most of the XML I am working with is poorly formatted (actually, all one line).
I guess a reasonable follow up question would be, does anyone know of a good XML editor (that doesn't cost much)? But I would really prefer to do my editing in Dev Studio, so a plugin is still preferable.
Thanks,
Cagey
|
|
|
|
|
Hi,
I don't know about a beautifier, but have a look at www.firstobject.com, there will be an inexpensive (no cost) xml editor.
Regards
G. Steudtel
|
|
|
|
|
|
|
Certainly not a plugin, though you could add it to your tools menu easily enough. This is what I use:
using System.IO;
using System.Xml;
class FormatXml {
static void Main(string[] args) {
XmlTextReader r = new XmlTextReader(args[0]);
XmlTextWriter w = new XmlTextWriter(new StreamWriter(args[1]));
r.WhitespaceHandling = WhitespaceHandling.None;
w.Formatting = Formatting.Indented;
w.Indentation = 1;
w.IndentChar = '\t';
w.QuoteChar = '\'';
w.WriteNode(r, false);
w.Close();
}
}
Adjust the Indentation, IndentChar and QuoteChar properties to match your tastes.
--
-Blake (com/bcdev/blake)
|
|
|
|
|
Frontpage 2003 (ick!) beautifies XML. It is a very poor XML editor though (no surprise eh?).
|
|
|
|
|
I have an XSLT transform that's used to transform an XML file into WebControl treenodes. I'm wanting to use script in the transform, but in order to do so, I have to import the xmlns:msxsl namespace.
When I do this, that namespace is also imported into the first <TREENODE> of the resulting XML. This causes the treeview webcontrol to give the error "The data at the root level is invalid.". How do I stop this namespace from being imported into the resulting XML?
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Use the exclude-result-prefixes attribute on the stylesheet.
(Replying to my own post again!)
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
My team and I are working with XML, and want to use the MSXML parser. I've heard that the MSXML parser only comes with IE5 and above. Is there a way to distribute it with your app, or download it separately from IE5/6? We don't want to have to have a certain version of IE be a requirement for the use of our library.
Thanks!
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
|
Thanks!
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
What could be wrong here??? I get the error "Invalid at the top level of the document"; however, loading the exact same text from a file using load() works!
CoInitialize();<br />
<br />
CComPtr< IXMLDOMDocument2 > pDocument;<br />
pDocument.CoCreateInstance( CLSID_DOMDocument40, NULL, CLSCTX_INPROC_SERVER );<br />
<br />
VARIANT_BOOL status;<br />
<br />
pDocument->loadXML( BSTR( "< ParticleSystem />" ), &status );
|
|
|
|
|
Without checking this out it may be because of the BSTR constructor you are using. BSTR's are unsigned short pointers, while you are passing in a const char* so a pointer cast is probably done (by the compiler) so two characters from your const char will be going into one character of the BSTR ie could be any character!! I suggest you try using CComBSTR, _bstr_t, or SysAllocString (and a matching free) to create your string to parse...
|
|
|
|