|
I have two different applications one for each company.
These companies are partners and need to interchange data all time betweent their apps.
Could someone give me a Guideline as to what i need to do make these apps. interchange data using XML
Both apps were created in c#
Thanks
Kourvoisier
|
|
|
|
|
- Figure out the information that needs to get exchanged.
- Write a DTD or schema describing the XML document structure that will hold the data to get exchanged.
- Create objects/methods in the two applications to read/write XML documents conforming to the standard that you developed in the last step.
- Figure out how the applications will communicate with one another: files, messages, TCP/IP sockets, etc.
- Implement the ability for the applications to exchange those XML documents over your chosen channel.
- Profit.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
I currently have a bunch of XML files that represent different "file types" in my project. For example, one defines the project heirarchy, another defines a template, etc.
When the user chooses to load a new template, I don't want them to try to load in a project definition file by mistake. I only want them to see template files.
My solution thus far has been to define a unique windows extension for each "file type". Eg. ".tmpml" for template, ".prjml" for project, etc. Using a filter in the OpenFileDialog ensures that the user only sees compatible files.
But these aren't real, registered windows extentions and if a user tries to open one up from Windows Explorer, it will not be recognised as an XML file. There also may be conflicts with other applications that may use the same file extension.
Ideally what I'd like to do is to have all these files stored with the standard ".xml" extension, but have a way of differentiating them in the OpenFileDialog.
I can't think of any way to do this short of writing my own OpenFileDialog, but I don't want to go there... Is there any way to write a custom filter that looks at the file contents rather than just the extension?
|
|
|
|
|
hi,
I have some program in C# like this
XmlDocument XmlDom1 = new XmlDocument();
XmlDocument XmlDom2 = new XmlDocument();
XmlDom1.Load("Test1.xml");
XmlDom1.Load("Test2.xml");
System.Xml.Xsl.XslTransform XslObj = new System.Xml.Xsl.XslTransform();
XslObj.Load("Common.xsl");
System.Xml.Xsl.XsltArgumentList ARG = new System.Xml.Xsl.XsltArgumentList();
//ARG.AddParam("Test","urn:PC",XmlDom2);
ARG.AddExtensionObject("urn:PC",XmlDom2);
System.IO.StringWriter sw = new System.IO.StringWriter();
System.Xml.XPath.XPathNavigator xdNav = XmlDom.CreateNavigator();
XslObj.Transform( xdNav,ARG,sw);
return sw.ToString();
I am passing a xml object XmlDom2 like
ARG.AddExtensionObject("urn:PC",XmlDom2);
Now how will i get this in the xsl(Common.xsl)
|
|
|
|
|
-- Sorry about the poor formatting, but I seem to have problems with XML tags in PRE blocks. --
I was thinking about writing a tiny app to maintain my expenses, and wanted to store the info in an XML file. I want every transaction to have a description and the amount involved. Additionally, I want the date info to be stored. Should I do it like
<transactions>
<year year="2005">
<month month="11">
<day day="7">
<transaction type="expense">
<description>Auto from station</description>
<amount>60.00</amount>
</transaction>
<!-- Other transactions for the same day -->
</day>
<!-- Other transactions for the same month -->
</month>
<!-- Other transactions for the same year -->
</year>
<year year="2006">
<!-- blah blah blah -->
</year>
</transactions>
or is there a better way? ***I don't like having an element which has an attribute with the same name***. Of course, I did come up with the idea of
<transactions>
<transaction year="2005" month="11" date="6" type="expense">
<description>Auto from station</description>
<amount>60.00</amount>
</transaction>
</transactions>
but the year, month and date attributes are ***repeated too often***.
What would you suggest? Should I simply change the nomenclature of #1 somehow, or should I go for something totally different?
Cheers,
Vikram.
|
|
|
|
|
Vikram A Punathambekar wrote: but the year, month and date attributes are ***repeated too often***.
Why? Looks fine to me. Unless you have the need to group other things by year/month/day, i don't see any reason not to use the more succinct syntax.
|
|
|
|
|
I develop web service with extensions that encrypt and compress some parameters of web method.
So I need get certain node("soap:Envelope/soap:Body/SendServiceDataInHeader/Body") in SOAP
message(got by serialization of web method) with XPath expression.
Here is SOAP message:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<ProtocolData xmlns="http://tempuri.org/">
<IsEncrypted>true</IsEncrypted>
<IsCompressed>true</IsCompressed>
</ProtocolData>
</soap:Header>
<soap:Body>
<SendServiceDataInHeader xmlns="http://tempuri.org/">
<To>zhornick@mail.ru</To>
<Cc />
<Subject>Subj</Subject>
<Body>Body</Body>
</SendServiceDataInHeader>
</soap:Body>
</soap:Envelope>
I tried with below code snippet but it doesn't work. It may be due to default namespace.
XmlDocument xd = new XmlDocument();
xd.Load("d:\\x.xml");
XmlNamespaceManager nm = new XmlNamespaceManager(xd.NameTable);
nm.AddNamespace("soap", "http://schemas.xmlsoap.org/soap/envelope/");
nm.AddNamespace(String.Empty, "http://tempuri.org/");
XmlNode n =
xd.SelectSingleNode("soap:Envelope/soap:Body/SendServiceDataInHeader/Body", nm);
Of course I can get this node by writing:
XmlNode n =
xd.SelectSingleNode("soap:Envelope/soap:Body",
nm).FirstChild.FirstChild.NextSibling.NextSibling;
but it is not reliable and I want through direct XPath expression.
Help me resolve task please!
Andriy Zhornyk
|
|
|
|
|
I'm am trying to read and write some data from an AutoCad drawing to XML document, using VBA.
Can anyone assist me by providing a tutorial.
Thanks
Steven Houghton
|
|
|
|
|
The Problem: IE will sniff my data file and figure out it's REALLY in XML format, and will just render it as HTML rather than prompting the user to pass it to the application associated with my filename extension.
Description:
I have an C# Winforms application that takes data in a small input file which happens to be in XML format. Prior to this, I gave the file a custom extension (let's call it .mya for example) and associated that extension with my APP, so when someone clicked on the extension, it looked for an app already running, and if it found it, it sent that as an argument, otherwise it loaded the file itself. The app then took the data out of the custom XML file (.mya) and, among other things, sticks the data on a column in a datagrid.
Now, I'd like to set things up so when someone goes to a file like this as an URL in IE or Firefox, it will recognize the extension and call up my app. To do this, I created my own MIME type "application/myapp", had the Apache web server on the other end send the file type as that content type in its HTTP header, and then wrote to the registry under MIME/Database/Content Type my new data. I added the extension string there as .mya I then tried it out with Firefox, and it worked just fine.
It did not work at all with IE. IE sniffs the file and says, "This is actually an XML file" despite the extension and renders it as such in the browser. If I encrypt or encode the file as binary, this may force IE but I'd prefer not to do that if I don't have to.
One possibility is to get this to work with IE, I have to generate a GUID for my app and and add it under my MIME registry key as the CLSID. Then, somehow I go to my app and register this as a COM object, and support the object passing. Trouble is, I'm not sure exactly how to do that in C#.
All this seems quite complicated for something seemingly so simple. Anyone able to help me out -- perhaps there's a better way to do it. Or, perhaps generating the CLSID in the registry and then supporting that in my code is easier than I'm thinking.
Thanks a lot for everyone's help!
|
|
|
|
|
I am maintaining an application that uses the XmlSerializer to import and export data. I would like to make some modifications to the internals of the application, but I need to maintain backward compatibility with older XMLs that customers may have.
Essentially I'm trying to change
[XmlAttribute]
public string CashFlowType;
, which contains the name of the type, to this
[XmlAttribute]
public CashFlowType CashFlowType;
, which would be an object that encapsulates all of the details of the object instead of just the name.
The problem is that the Serializer can't put the complex type CashFlowType into an XmlAttribute, and rightly so.
The ideal solution would be to use [XmlElement] and write out the fields that I need to deserialize, but for the sake of maintaining backward compatibility, I cannot change the attribute to an element.
I have tried setting all of the fields of CashFlowType to [XmlIgnore] and I overrode ToString() in the hopes that the serializer would put the result of ToString in the attribute but it throws an exception just the same.
If anyone has any ideas it would be greatly appreciated.
Thanks, Jason
|
|
|
|
|
when using xml with microsoft visual c++ express edition beta 2 i get a syntax error '<' on the first line:
<?xml version="1.0" encoding="utf-8" ?>
when i include the xml file in my program i get this error.
does anyone know how to fix this problem??
any help would be greatly appreciated.
thank you in advance for the help.
- Kyle
|
|
|
|
|
Sounds like you're including it as a source file.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
how am i supposed to include it?
|
|
|
|
|
Why do you want to ? You're not going to compile it, are you ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
i want to use the file as the contents of a treeview control
- Kyle
|
|
|
|
|
So it needs to be in the same folder as your exe. It doesn't need to be part of the project.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Am in uni and have 2weeks to finish my assignment...i could just design it and not make it but I want to push myself and learn new things. I want to make an interactive quiz but it has a difference (a very rough story board is on... http://www.lesleytalbot.co.uk/testingwebsite/testingperceptionsgames.htm).
So far I know im going to make an xml doc containing all of my information and then i can import it into flash or director but i do not know which one to use - which would be best! any ideas?
My interactive quiz is about Perceptions - how well we perceive others - e.g. the player will look at a Photograph of someone (and be able to listen to a 15sec clip of their voice). There will be 5 questions asked about the person and the player gets a point for each they get right. Then it moves on to another photograph of someone and the same thing occurs.
I would like to be able to program it to:
* display a photograph and the answers to the 5 questions somewhere inbetween the incorrect ones
* be able to count the score
* to pick out a further 7 photographs from a database of 20, therefore at random would be good
* then after the 8 have been seen and answered an end screen will show with the score of the player
to make things complicated I have 2 games, the second is rather like Pairs except the player matches a photograph to aspects of peoples' characteristics e.g. shy or outgoing. so for this i need:
* to pick 10 photographs at random and have the matching characteristics randomly assembled on the screen
* program needs to know which characteristic matches to what photograph
* program needs to do something when the player matches the correct photograph and characteristic e.g. both disappear
* then when all are matched up the program shows an end screen and the time taken for the game to be completed
I know how to generally go about doing this in both Flash and Director and at the minute would prefer Director because it seems a lot simpler (plus I made a tile based game in Flash and confused the heck out of me for a long time!). But if you guys were to tell me such a think would work better in Flash I would use it!
Any ideas or help would be well appreciated,
thanks,
Lezlea
|
|
|
|
|
hi Lezlea,
Flash would be better option to use with XMl files in my thinking.
Sushant Mathur
Ocwen Financial Sol. Pvt. Ltd,
Bangalore,
INDIA.
|
|
|
|
|
I am trying to create an XSLT stlesheet for an xbel doc. Can anyone help?
I it has to have to include 2 parameters that will determing whether or not the description and book mark url will be displayed.
this is what I have-
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />
- <xsl:template match="/">
- <html>
- <!-- gets the titile of the document
-->
- <head>
- <title>
<xsl:value-of select="/xbel/title" />
</title>
</head>
- <body>
- <h1>
<xsl:value-of select="/title" />
</h1>
<br />
<xsl:apply-templates />
</body>
<link rel="stylesheet" type="text/css" href="xbel.css" />
</html>
</xsl:template>
- <xsl:template match="/folder">
<br />
<xsl:apply-templates select="." />
<xsl:apply-templates select="folder/folder" />
<br />
</xsl:template>
</xsl:stylesheet>
here is the source-
<?xml version="1.0"?>
<!DOCTYPE xbel PUBLIC "+//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML" "http://pyxml.sourceforge.net/topics/dtds/xbel-1.0.dtd">
<?xml-stylesheet type="text/xsl" href="C:\Documents and Settings\221442\Desktop\XML\U1027.xsl"?>
<xbel version="1.0">
<title>Some of David's Bookmarks</title>
<folder>
<title>Food</title>
<folder>
<title>Tea</title>
<bookmark href="http://www.uptontea.com/">
<title>Upton Tea Imports</title>
<desc>Purveyor of the world's finest teas.</desc>
</bookmark>
</folder>
<folder>
<title>Spices and Herbs</title>
<bookmark href="http://www.penzeys.com/">
<title>Penzeys Spices</title>
<desc>The best way to get your herbs and spices (both in terms of price, quality, and flavor). Their print catalog is wonderfully educational, and full of recipes.</desc>
</bookmark>
</folder>
<folder>
<title>Chips</title>
<bookmark href="http://www.dirtys.com/">
<title>Dirty Potato Chips</title>
<desc>My very favorite potato chips. Their motto is, "We don't wash out the natural potato flavor, so our chips are crunchier and tastier."</desc>
</bookmark>
<bookmark href="http://www.artsandmarys.com/">
<title>Art's and Mary's: Homestyle Tater Chips</title>
<desc>These are very good too. I usually get the "Dill Tater Chips", since dill chips are not commonly found.</desc>
</bookmark>
<bookmark href="http://www.birdseyefoods.com/tims/">
<title>Tim's Cascade Style Potato Chips</title>
<desc>My chip of choice when I'm in the Pacific Northwest (or whenever else I can find these in New England!). All are good -- especially the "Cracked Peppercorn"!</desc>
</bookmark>
<bookmark href="http://www.capecodchips.com/">
<title>Cape Cod Potato Chips</title>
<desc>Cape Code offers excellent chips made from different potato varieties (Dark Russet, Golden Russet and Yukon Gold). The "Firecracker Barbeque" chips don't last long when I'm around.</desc>
</bookmark>
</folder>
</folder>
<folder>
<title>HTTP Clients</title>
<bookmark href="http://www.mozilla.org/releases/stable.html">
<title>Mozilla</title>
<desc>Mozilla is an open-source web browser and toolkit, designed for standards compliance, performance and portability. Mozilla.org provides binaries for testing and feedback.</desc>
</bookmark>
<bookmark href="http://www.netscape.com/download/">
<title>Netscape</title>
<desc>Netscape 7.0 offers enhanced performance and stability plus a fine-tuned Netscape Gecko browser engine to speed you through the most common online activities.</desc>
</bookmark>
<bookmark href="http://www.opera.com/">
<title>Opera</title>
<desc>Opera is a high-quality Web browser available on a wide range of platforms. The Opera browser is a fast, full-featured, award-winning browser available for operating systems, including Windows, Linux and Mac OS.</desc>
</bookmark>
<bookmark href="http://www.microsoft.com/ie/">
<title>Microsoft Internet Explorer</title>
<desc>Internet Explorer 6 Service Pack 1 (SP1) sets a new standard in privacy, reliability, and flexibility. Come see how Internet Explorer is leading the way on the Web.</desc>
</bookmark>
<bookmark href="http://lynx.browser.org/">
<title>Lynx</title>
<desc>Lynx is a fully-featured World Wide Web (WWW) client for users running cursor-addressable, character-cell display devices (e.g., vt100 terminals, vt100 emulators running on PCs or Macs, or any other character-cell display). It will display Hypertext Markup Language (HTML) documents containing links to files on the local system, as well as files on remote systems running http, gopher, ftp, wais, nntp, finger, or cso/ph/qi servers, and services accessible via logins to telnet, tn3270 or rlogin accounts. Current versions of Lynx run on Unix, VMS, Windows95/NT, 386DOS and OS/2 EMX.</desc>
</bookmark>
<bookmark href="http://www.w3.org/Amaya/">
<title>Amaya</title>
<desc>Amaya is a browser/authoring tool that allows you to publish documents on the Web. It is used to demonstrate and test many of the new developments in Web protocols and data formats. Given the very fast moving nature of Web technology, Amaya has a central role to play. It is versatile and extensible and is available on both Unix and Windows platforms.</desc>
</bookmark>
</folder>
<folder>
<title>Extensible Markup Language (XML)</title>
<bookmark href="http://www.sciam.com/article.cfm?articleID=0008C786-91DB-1CD6-B4A8809EC588EEDF&ref=sciam">
<title>Scientific American: Feature Article: XML and the Second Generation Web: May 1999</title>
<desc>The combination of hypertext and a global Internet started a revolution. A new ingredient, XML, is poised to finish the job. by Jon Bosak and Tim Bray</desc>
</bookmark>
<bookmark href="http://www.sciam.com/article.cfm?articleID=00048144-10D2-1C70-84A9809EC588EF21&ref=sciam">
<title>Scientific American: Feature Article: The Semantic Web: May 2001</title>
<desc>A new form of Web content that is meaningful to computers will unleash a revolution of new possibilities . by TIM BERNERS-LEE, JAMES HENDLER and ORA LASSILA</desc>
</bookmark>
<bookmark href="http://www.w3.org/XML/1999/XML-in-10-points">
<title>XML in 10 Points</title>
</bookmark>
<folder>
<title>RSS</title>
<bookmark href="http://www.webreference.com/authoring/languages/xml/rss/intro/">
<title>Introduction to RSS - WebReference.com</title>
<desc>Rich Site Summary (RSS) is a lightweight XML format designed for sharing headlines and other Web content.</desc>
</bookmark>
<bookmark href="http://www.oreillynet.com/pub/a/network/2000/08/25/magazine/rss91.html">
<title>XML.com: RSS Delivers the XML Promise</title>
<desc>A solid, accessible introduction to working with RSS -- a simple, yet powerful, web content syndication format.</desc>
</bookmark>
</folder>
<folder>
<title>Extensible Stylesheet Language (XSL)</title>
<bookmark href="http://xml.com/pub/a/2000/08/holman/index.html">
<title>XML.com: What is XSLT?</title>
<desc>Part One of XML.com's series on the W3C's Extensible Stylesheet Language Transformation technology, written by XSLT instructor G. Ken Holman</desc>
</bookmark>
</folder>
</folder>
</xbel>
HpLif
-- modified at 14:32 Friday 28th October, 2005
|
|
|
|
|
Hi,
I am a beginner in XML,I have to update a particular element based on some action(say a button click) .
I need to select that element and Update all the attributes ,values everything to new values which will be accepted through a user interface
I know it may be simple.To be more precise I want the similar operation that we normally perform in a database .That is update the record if its already present.
Thanks
|
|
|
|
|
Nadia
this is normally done through a XmlDocument. Once you've loaded the xml document in the XmlDocument class, you can navigate through the nodes and change their value.
In C#
<br />
XmlDocument doc = new XmlDocument();<br />
doc.Load(@"c:\somePath\mydocument.xml");<br />
<br />
you can then select the specific node you want to alter<br />
<br />
XmlNodeList nodeList = doc.GetElementbyName("Book");<br />
foreach (XmlNode node in nodeList)<br />
{<br />
<br />
}<br />
doc.Save(@"c:\somePath\mydocument.xml");<br />
All XmlDocument methods and properties can be found here
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemXmlXmlDocumentMethodsTopic.asp[^]
Hope this helps.
Denevers
|
|
|
|
|
Let this is your XML file
<name>
<firstname>Sushant</firstname>
<surname>Mathur</surname>
</name>
so to update these values asp page would be like this:
<%@ Language=VBScript %>
<%
function genDOM(fname,lname)
dim xmldoc
dim ElemFname
dim ElemLname
set xmlDoc=CreateObject("Microsoft.XMLDOM")
xmlDoc.async="false"
xmlDoc.load("c:\Document1.xml")
If (xmldoc.parseError.errorCode = 0) Then
Set ElemFname = oMSXml.selectSingleNode("//firstname")
Set ElemLname= oMSXml.selectSingleNode("//surname")
fname =Request(user_name)
lname=Request(user_surname)
ElemFname.Text =fname
ElemLname.text=lname
else
msgbox(xmldoc.parseError.reason)
end if
end function
%>
</HEAD>
<BODY>
<FORM>
<P>
<INPUT id=text1 name="user_name"><BR>
<INPUT name="user_surname"><BR>
<INPUT type=button value=" click " onclick="<%=genDOM()%>" id=button1 name=button1>
</P>
</FORM>
</BODY>
</HTML>
Sushant Mathur
Ocwen Financial Sol. Pvt. Ltd,
Bangalore,
INDIA.
|
|
|
|
|
I would like to make a soap call that should work the following way:
For every method invocation
1. the client starts the server executable
2. the client pipes the input message to stdin of the server process
3. the server reads stdin, decodes the soap message and processes it
4. the output message is written to stdout by the server
5. the client decodes the message and continues
Ideally it would be possible to define a SOAP binding in the WSDL that define the executable to be started instead of specifying a URL. Is there something like a predefined EXE-binding in WSDL?
Are there SOAP frameworks that allow you to pipe SOAP via stdin/stdout instead of making a http request?
Best regards
Carsten
|
|
|
|
|
hi
i m in problem when i insert image through xml comments in .chm file
plz help me
|
|
|
|
|
|