|
Hi everyone,
I came across this prob...
I am a beginner in xml.
I wanted to create a xml file which stores the location of the images.
This xml file must be accessed in visual studio picture box and it must display each image wen i click the next button and back wen i press the previous button...
Please help
|
|
|
|
|
kpuneeth7 wrote: I am a beginner in xml.
Then you should study some of the tutorials here and on MSDN on the use of XML. From the remainder of your question it appears that you are asking for a complete image viewer solution. If you have no idea how to start on this problem then you have a lot of studying still to complete.txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" id="BookEasy">
<xsd:element name="BookEasy">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Control">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ControlID" type="xsd:int"/>
<xsd:element name="ReservationRequest">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="InDate" type="xsd:dateTime"/>
<xsd:element name="Period" type="xsd:int"/>
<xsd:element name="Adults" type="xsd:int"/>
<xsd:element name="Children" type="xsd:int"/>
<xsd:element name="Infants" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="Operators">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Operator" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="OperatorID" type="xsd:int"/>
<xsd:element name="Rooms">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Room" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="RoomID" type="xsd:int"/>
<xsd:element name="Availability">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="IsAvailable" type="xsd:boolean"/>
<xsd:element name="Days">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Day" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Date" type="xsd:dateTime"/>
<xsd:element name="IsAvailable" type="xsd:boolean"/>
<xsd:element name="Rates">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="FullRate" type="xsd:decimal"/>
<xsd:element name="LastMinuteRate" type="xsd:decimal"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>modified on Tuesday, February 23, 2010 12:29 AM
|
|
|
|
|
Do you have a question? I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi,
I want to delete the duplicate and some hard coded XML node in XMLDocument throgh C#.
What is the method to do the same?
I am new to the use of XML in C#.
Please help me out.....!!!!!!!!!!!
Thanks
|
|
|
|
|
Hi All,
I try to use MSXML with xml files which contains namespaces. But I can't figure out how to do!
Here is an excerpt of my XML file:
<?xml version="1.0" encoding="utf-8"?>
<BENCH xmlns:VODPC_VOD="urn:VODPC:VOD:schema:20060809">
<VODPC_VOD:GRAPH state="running" currentFlowID="1" removeOnExit="FALSE">
</VODPC_VOD:GRAPH>
</BENCH>
When I load the file with MSXML6, no problem.
I try to access node BENCH with XPath "/BENCH" : no problem.
But when I try to access node VODPC_VOD:GRAPH with XPath "/BENCH/VODPC_VOD:GRAPH", I get an exception, which contain no valuable information:
First-chance exception at 0x75ac9617 in XXXXXX.exe: 0xE0000001: 0xe0000001.
First-chance exception at 0x75ac9617 in XXXXXX.exe: 0xE0000001: 0xe0000001.
First-chance exception at 0x75ac9617 in XXXXXX.exe: 0xE0000001: 0xe0000001.
First-chance exception at 0x75ac9617 in XXXXXX.exe: 0xE0000001: 0xe0000001.
First-chance exception at 0x75ac9617 in XXXXXX.exe: Microsoft C++ exception: _com_error at memory location 0x0025dac4..
I set these flags before to load:
m_pXMLDoc->async = VARIANT_FALSE;
m_pXMLDoc->preserveWhiteSpace = VARIANT_TRUE;
m_pXMLDoc->validateOnParse = VARIANT_TRUE;
m_pXMLDoc->resolveExternals = VARIANT_TRUE;
As you can understand, I work in C++. I'm an IT profesionnal since 18 year.
My problem is that I do not know what namespace is used in the file, so I don't want to have to tell MSXML6 what namespaces are used IN THE FILE. I guess it's its job, no ?
If anybody have an idea ...
Thanks a lot
Patrice
|
|
|
|
|
You have to tell MSXML what namespace prefixes your XPath expressions use. When parsing XML, the parser remmebers the namespace URIs, NOT the prefixes used in the documents. That means that your code has to define the prefix to URI mappings used in your XPaths. Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
Hi all,
I've xml string and I can load it with XmlDataDocument.LoadXml successfully,
so that OuterXml shows the real xml string. But when I want to load in a dataset, the result dataset has no table(Tables.Count=0).
Typical code is as follows:
...
XmlDataDocument Doc = new XmlDataDocument();
/*
string Str = "<Result><DN>22800661</DN><ID>1</ID><Status><Line>Idle</Line></Status></Result>";
*/
Doc.LoadXml(Str);
DataSet datasetResult = Doc.DataSet;
if(datasetResult.Tables.Count == 0) return;
...
and it returns that means datasetResult.Tables.Count is always 0.
Can anyone help me, what is wrong?
Thanks in advance
|
|
|
|
|
Maybe this is what you want ?
string Str = "<Result><DN>22800661</DN><ID>1</ID><Status><Line>Idle</Line></Status></Result>";
System.IO.StringReader sr = new System.IO.StringReader(Str);
XmlDataDocument Doc = new XmlDataDocument();
Doc.DataSet.ReadXml(sr);
DataSet datasetResult = Doc.DataSet;
if (datasetResult.Tables.Count == 0) return;
|
|
|
|
|
Hello all you wonderful people
<br />
<br />
<?xml version="1.0" encoding="unicode"?><br />
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:osxml="osxml" version="1.0"><br />
<_locDefinition><br />
<_locDefault _loc="locData"/><br />
<_locTag _locAttrData="pad-left,pad-right">p</_locTag><br />
<_locTag _locAttrData="height,width">textarea</_locTag><br />
<_locTag _locAttrData="minsize,noindent">select</_locTag><br />
<_locTag _locAttrData="size">progressbar</_locTag><br />
<_locTag _locAttrData="size,maxlen">input</_locTag><br />
<_locTag _locAttrData="value">osxml:update</_locTag><br />
</_locDefinition><br />
<xsl:template match="fve-bad-pcr-registers"><br />
<osxml:text-mode-ui><br />
<head><br />
<footer color="RGBIXXXX"><xsl:text> ENTER=Continue</xsl:text></footer><br />
<meta key="ENTER" action="continue"/><br />
</head><br />
<body background-color="XXXX" foreground-color="RGBX"><br />
<font foreground-color="RGBI"><br />
Windows BitLocker Drive Encryption Information<br/><br />
</font><br />
<br/><br />
<br/><br />
The system boot information has changed since BitLocker was enabled.<br/><br />
<br/><br />
You must supply a BitLocker recovery key to start this system.<br/><br />
<br/><br />
Confirm that the changes to the system boot information are authorized.<br/><br />
<br/><br />
If the changes to the system boot information are trusted, then suspend and resume BitLocker. This will reset BitLocker to use the new boot information.<br/><br />
<br/><br />
Otherwise restore the system boot information.<br/><br />
<br/><br />
</body><br />
</osxml:text-mode-ui><br />
</xsl:template><br />
<br />
if User presses continue it goes to next line, if user press the "B" key then it goes to "progress-bar", otherwise quit.<br />
<br />
<xsl:template match="fve-bad-code-id"><br />
How do I prompt the user, trap a keypress and act upon the input in XML? What scripting language would you recommend to do this?
What do the loc lines do?
I am a newbie! JohnI Need VB.net help
|
|
|
|
|
XML is not a prgramming language - it's more a data format.
So…why are you using XML and what are you trying to achieve?Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
I have an asp page that request data from a remote site (API) via XML.
My code is as follows:
DataToSend = "http://jc.tee.id.com/api/2.0/"& Request("resource") &"?apikey=a0d523ddnfjfjkkfkfkf32c&format=HTML&pret typrint=true&links=resource-path-encoded&request_handler_uri=http%3A%2F%2Fwww.mysit e.com%2Fitems&styles=enhanced"
set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP.4.0")
xmlhttp.Open "GET", DataToSend, false
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
xmlhttp.send
Response.Write xmlhttp.ResponseText
This code works fine and returns data with no problem. However on page where the API has AJAX in it, the AJAX doesnt function.
For example, executing my code I pull up a table of contents page:
A | B | C | D | E
apple
adam
aligator
acorn
If I click in the title names, it takes me to the proper URL with no problem. if I click on a navigation letter (which is suppose to execute AJAX on the API side and pull in new titles), it just reloads the page.
I am assuming its because of MSXML2.ServerXMLHTTP.4.0.
I tried switching to 6.0 but this did nothing as well. Am i not able to execute AJAX or something through this remote site??
Any help or insight anyone could give me would be greatly appreciated.
Thanks
|
|
|
|
|
I try XSL Transfrom on client-side using javascript. My XSL file has a import tag in itself, but it couln't find the another XSL file. I have to excute this transform on Client-Side for
some reason. How can I put the import href content
Here goes my test code. this page written with .NET
Javascript code on the webpage.
function Transform() {
var xsl = new ActiveXObject("MSXML.DOMDocument");
var xml = new ActiveXObject("MSXML.DOMDocument");
xsl.async = false;
xsl.load(dataXmlPath);
xsl.async = false;
xsl.load(styleXslPath);
var data = xml.transformNode(xsl);
}
number.xml (XML Data file)-----------------------
<?xml version='1.0'?>
<data>
<circle>
<radius>12</radius>
</circle>
<circle>
<radius>37.5</radius>
</circle>
</data>
calc.xsl (XSL Style file)------------------------
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:include href="calc2.xsl"/>
</xsl:stylesheet>
calc2.xsl (XSL import file)------------------------
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="data">
<circles>
<xsl:for-each select="circle">
<circle>
<xsl:copy-of select="node()"/>
<circumference>
<xsl:value-of select="radius"/>
</circumference>
</circle>
</xsl:for-each>
</circles>
</xsl:template>
</xsl:stylesheet>
|
|
|
|
|
<script>
function Transform() {
var xsl = new ActiveXObject("MSXML.DOMDocument");
var xml = new ActiveXObject("MSXML.DOMDocument");
xml.async = false;
xml.load("number.xml");
xsl.async = false;
xsl.load("calc.xsl");
return xml.transformNode(xsl);
}
alert(Transform());
</script>
|
|
|
|
|
yes. it works. thank you.
actually i tested with below script function in order to get a XML Object.
function loadXMLDoc(filepath) {
if (window.XMLHttpRequest) {
xhttp=new XMLHttpRequest();
}
else {
xhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.open("GET",filepath,false);
xhttp.send("");
return xhttp.responseXML;
}
I thought it's the same but it wasn't..
var xsl = new ActiveXObject("MSXML.DOMDocument");
xsl.async = false;
xsl.load("calc.xsl");
this works fine.
|
|
|
|
|
|
No one is going to look at this mess of unformatted garbage.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Did you bother to preview this before you posted it, or read it afterwards? I assume not as it is unreadable. Please edit the content and place between <pre></pre> tags using the "code block" button at the top of the edit window.
MVP 2010 - are they mad?
|
|
|
|
|
Hi
I want to implement a webservice with soap and C#
But i am wondering about to change tag as soapenv
How can this be possible?
|
|
|
|
|
Hi,
I'm not sure if I understood your problem. You want to implement a webservice with C#.
For the first steps have a look here:
Your first C# Web Service[^]
Or if you want to use WCF take a look here:
Writing your first WCF Service[^]
SOAP is just the protocol used to call a webservice. Fortunately this protocol is transparent for you, since the .NET framework manages everything for you (serialization, deserialization, transport etc.)
Regards
Sebastian
|
|
|
|
|
How is it possible to import a COM dll from any flavor of unix.
On C++ on windows we can use the #import command to achieve this.
Does the same command help on any unix flavor.
The intent is to use the parsing functionality of msxml [parser.
|
|
|
|
|
AFAIK, Unix doesn't have the necessary COM infrastructure to let you use COM. So, you're out of luck.
However...there are a lot of other XML parsers out there - I'd suggest looking at libxml2[^], expat[^] or Xerces-C++[^].
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
Please let me know your comments in below:-
1) Xerces: we need a separate platform/architecture specific binary. This is provided by Xerces.
2) libxml2- Can this be used on unix. I guess its usage is limited to windows.
3) xmllite is another one- One needs to leverage COM technology as interfaces are provided for XML related functions.
4) msxml works on similar way as that in 3)
The requirement is to read a simple xml document in an application.
This application would hold the XML DOM if created in memory in static area as the string that holds the static XML string would be static.
|
|
|
|
|
Xerces and libxml2 are both avaiable Windows OR Unix. Xerces is part of the Apache project, libxml2 part of Gnome (I think).
Neither msxml nor XML Lite are available on Unix.
Another cross-platform alternative - RapidXML[^].
I would go for RapidXML, I think.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
I have heard that parsers that support XPATH give the best performance and should be used if applications from scratch are used.
IS RapidXML XPATH suppotive?
If no, let me know your comments?
|
|
|
|