|
If you mean something like xsd.exe[^] that comes with Visual Studio.NET, or JAXB[^], you're out of luck currently as far as free tools go (of course, xsd.exe isn't free, but you may well have VS.NET anyway...). However, xsd does say that it'll support anything that implements System.CodeDom.Compiler.CodeDomProvider, which C++ may do when Visual Studio 2003 arrives. Of course, it would still only be Managed C++....
Other alternatives (all for Java ) are Castor[^], Jaxme[^] and Jibx[^]
Of course, if you've got money to spend, there are C++ options like xmlspy[^] and RogueWave's XML Object Link[^]
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
Thank you very much for this information! I was beginning to sketch a little on an implementation very much like RogueWaves XML Object Link.
I think I will look into this CodeDom-stuff. Maybe I could write my own classes to generate "pure" C++. Looks like I can forget that.
--
Tune your mind, reach inside, peel away
Touch, Taste, Feel, Saturation
|
|
|
|
|
XML Data Binding tools provide this, but you need to describe your xml in a schema (xsd/xdr/dtd).
http://www.rpbourret.com/xml/XMLDataBinding.htm lists available tools.
I use the wizard from Liquid Technologies:
http://www.liquid-technologies.com/Products/LXDBWizard.htm
|
|
|
|
|
I want to be able to concatenate several XML files together, and I can't find anything on W3C.org that says xml has an "include" tag. Does it? Am I blind? Or am I screwed?
Conversely, the reason I need this is because the stupid XmlDataDocument.Load method can't be called more than once. It requires a blank document, and there is no Append or similar function.
Marc
Help! I'm an AI running around in someone's f*cked up universe simulator. Sensitivity and ethnic diversity means celebrating difference, not hiding from it. - Christian Graus Every line of code is a liability - Taka Muraoka Microsoft deliberately adds arbitrary layers of complexity to make it difficult to deliver Windows features on non-Windows platforms--Microsoft's "Halloween files"
|
|
|
|
|
No you are not blind. There was an include processor command but it was rather unsecure do a google on "Xml eXternal Entity" and was removed if my memory is working tonight.
Take a look at XInclude (candidate recomendations) and XLink (recomendation)
XInclude[^]
XLink[^]
""
|
|
|
|
|
Have a look at the ImportNode and AppendChild methods. Something like this should work:
XmlDataDocument doc1 = LoadDoc1();
XmlDataDocument doc2 = LoadDoc2();
foreach(XmlNode source in doc2.DocumentElement.ChildNodes)
doc1.DocumentElement.AppendChild(doc1.ImportNode(source, true));
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
Hi,
I have many entries in my XML and I would like to search for one in particular (the one the user wants) but not show it, just take that entry and check an element in it, how would this be done.
Ex:
<?xml version="1.0" encoding="UTF-8"?>
<Airports>
<Airport>
<ICAO>KABE</ICAO>
<Name>Allentown Intl PA</Name>
<Lat>40.652364</Lat>
<Long>-75.440403</Long>
</Airport>
<Airport>
<ICAO>KABI</ICAO>
<Name>Abilene Reg. TX</Name>
<Lat>32.411319</Lat>
<Long>-99.681897</Long>
</Airport>
I want to look up KABE and put its Long value in a double. (BTW, I have no schema for this file, only the XML, would a schema be helpfull here?)
Thanks...
// JS Paquet
cout << "Thank you all" << endl;
|
|
|
|
|
Try something like:
XmlNode node = doc.SelectSingleNode("/Airports/Airport[ICAO='KABE']/Long");
double lon = double.Parse(node.InnerText);
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
Hello,
I have one element named LoadConfig. It has one attribute named 'Type'. The attribute 'Type' can have two values('PreDefined' or 'UserDefined'). If attribute value is 'PreDefined', LoadConfig element can have 3 child elements. If attribute value is 'UserDefined' LoadConfig element can have any type xml nodes as its childnodes. Can anybody explain how to make schema for this.
Thanks,
Chito
|
|
|
|
|
I think you would be better off having two elements (LoadConfigDef, LoadConfigUser) with the parent having a selection of which one.
""
|
|
|
|
|
I don't know XML and I mean it. :p
I need code in VC++ that can make an XML file out of a byte array.
Can somebody help with that?
|
|
|
|
|
With out some description of your goals and what the structure of the data is in the array, any suggestions would be rather open. Have you looked through any tutorials? Like the ones I mention below.
""
|
|
|
|
|
I need a code snippet in VC++ that can read an ascii (or Base64 encoded) file and generate an XML file. thanks for your 'help'.
|
|
|
|
|
Well do you just need to read in a string and then save it as a CData section to a single element? I would expect you wanted to organize the data in some hierarchical scheme.
Have you just browsed the XML code here in CP and looked for examples?
Kristen Wegner's is good work (along with many others) http://www.codeproject.com/soap/pugxml.asp[^]
There are several "SET" methods to add elements, attributes and their values.
""
|
|
|
|
|
Hi,
I have a xml file (e.g. mydata.xml). How am I able to make use of javascript to select elements to be displayed on a HTML?
E.g. Using dropdown menu, I select 'Name'. Onclick the Submit button will enable the javascript to pull out all the 'Name' elements in mydata.xml and display on IE. Is this possible?
Also, possible to have logical 'AND' function?
Thanks in advance.
|
|
|
|
|
Just FYI,
Roger Costello has updated his excellent tutorials and white papers. Feb 2003
xfront[^]
""
|
|
|
|
|
How do i append data to an existing XML file using C#? I have two processes that need to populate the same XML file.
|
|
|
|
|
XmlDocument doccy = new Document();<br />
doccy.Load(filename);<br />
<br />
XmlElement root = doccy.SelectSingleNode("rootnode");<br />
<br />
XmlElement newRecord = doccy.CreateElement("record");<br />
root.AppendChild(newRecord);<br />
<br />
doccy.Save(filename);
obviously you will need to implement a locking mechanism.
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
I read that IE still uses msxml 2.0 for xml processing. Is this correct?
If I want to include xml functionalities in my vc++ app, is it recommended to use msxml4.0 sdk? I hate to redistribute msxml4.0 with my app. assuming that most people have IE 5+, couldn't I just use msxml2.0? (i can't seem to find much information on msxml sdk prior to version 3)
thanks in advance,
|
|
|
|
|
Version 3.0 of MSXML is shipped with IE5+, IE use what you tell it to use, while default is MSXML3 (not 4), for example if you create an instance of MSXML in the script with string "MSXML2.DOMDocument", version 3 will be used (assuming it is installed), but if you use "MSXML2.DOMDocument.4", you'll get a version 4.
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|
|
:(hi all,
I am new to this forum..but not new to CP..can anyone of you help me out..I have an XML document and I parsed it to get the data..and show it in in IE 5.0 but the same thing doesnt work in Netscape..I am having Netscape 6.1...I am using Javascript to render XML..Any help or pointers are welcome..Please help..
thanks in advance..
Cheers
Himanshu
|
|
|
|
|
Post the code please xxhimanshu, then we can help. Just saying "using Javascript to render" does not help us much.
Paul Watson Bluegrass Cape Town, South Africa
Macbeth muttered:
I am in blood / Stepped in so far, that should I wade no more, / Returning were as tedious as go o'er
DavidW wrote:
You are totally mad. Nice.
|
|
|
|
|
hi,
i cannot understand what code.. the code that i used does well in IE..and does everything I want to do..and the way i want to...but I want to know as I am creating a DOM for microsoft as new ActiveXObject("Msxml2.DOMDocument.3.0");...and also some other things which work fine in IE doesnt work in NETSCAPE..as document.all doesnt work..whatever I have searched for and found was like that..I will have to use XSL Stylesheets..to render XML and show it in Netscape.....but I am having a problem..I dont have a static XML file...so I cant create a XSL which is dynamic...so is there any other way to do it..as we do in Microsoft Internet Explorer..any hints and ideas are welcome..please help!!!!!!!!!
TIA...
himanshu
|
|
|
|
|
The code I meant was your code which is giving the problem on Netscape. If you can post that code then maybe we can help you out.
From what I can gather though I recommend you ditch the client side processing and do it all server side. It is perfectly possible to apply an XSL transform to a dynamic XML source.
The best way is to have an ASPX (or ASP page) which creates an XmlDocument and XslTransform . you then load up the XmlDocument with your dynamic XML (in .NET it can take in streams or physical files) and Response.Write out the XslTransform output.
Paul Watson Bluegrass Cape Town, South Africa
Macbeth muttered:
I am in blood / Stepped in so far, that should I wade no more, / Returning were as tedious as go o'er
DavidW wrote:
You are totally mad. Nice.
|
|
|
|
|
I did it for IE..ad it is working fine..but the same program doesnt give any output in netscape..that is because netscape doesnt support some of the methods..so there is no other way..than to write a new approach which either can work fine in both..IE and netscape..or write routines for netscape and IE...but I dont know the idea as how to start with...can you help me out..
cheers
Himanshu
|
|
|
|