|
windows service? meaning "scheduled task"?
can you please explain?
or maybe refer me to a link/article?
thank you
|
|
|
|
|
Hey,
anyone knows if there are handy tools to create a XSD scheme based on a XML file?
It's because I'm not familiar with XSD scheme's and I have to use one in my project.
My scenario is the following:
in my XML file i have the following structure:
<transfer>
<customer id="mh55">
<document id="1">
<article id="computer">
<priceIncl>565</priceIncl>
<priceExcl>412</priceExcl>
<priceVAT>85</priceVAT>
</article>
<article id="screen">
... same as above ...
</article>
</document>
<document id="2">
... same as above ...
</document>
</customer>
<customer id="xdc88">
... same as above ...
</customer>
</transfer>
|
|
|
|
|
|
|
just add it to a project in visual studio, and then there's an option if you right click on it, to make a schema for it... free.
/\ |_ E X E GG
|
|
|
|
|
hi,
I have written code to insert node
but its inserting after root node i want that it should insert after farm-config
pls check my code
private void button6_Click_1(object sender, System.EventArgs e)
{
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load("c:/farm-config.xml");
XmlElement farmelement = xmldoc.CreateElement("farm");
xmldoc.DocumentElement.InsertBefore(farmelement,xmldoc.DocumentElement.LastChild);
FileStream fsxml = new FileStream("c:/farm-config.xml",FileMode.Truncate,FileAccess.Write,FileShare.ReadWrite);
// XML Document Saved
xmldoc.Save(fsxml);
}
Pls modify my existing code so that i could insert after farm-config node
Hi this is my original stururtue of XML file
<?xml version="1.0" encoding="UTF-8"?>
<root>
<farm-config>
<farm name="dev1">
<connection address="localhost" user="root" selectedConnection="1" password="ram">
<lastJob>Copy-All</lastJob>
<lastConnection startdate="2005-05-10" starttime="12:43:23" enddate="2005-05-10" endtime="12:58:32" />
<state>1</state>
</connection>
</farm>
</farm-config>
</root>
after inserting XML looks like in the given below structure
----- --------- ----------------
<?xml version="1.0" encoding="UTF-8"?>
<root>
<farm />
<farm-config>
<farm name="dev1">
<connection address="localhost" user="root" selectedConnection="1" password="ram">
<lastJob>Copy-All</lastJob>
<lastConnection startdate="2005-05-10" starttime="12:43:23" enddate="2005-05-10" endtime="12:58:32" />
<state>1</state>
</connection>
</farm>
</farm-config>
</root>
I want Xml to be inserted after farm-config
This should be inserted like that
I am giving you the structure of XML file
What fucntion should i write or modify my existing code
For the code see above
<?xml version="1.0" encoding="UTF-8"?>
<root>
<farm-config>
<farm />
<farm name="dev1">
<connection address="localhost" user="root" selectedConnection="1" password="ram">
<lastJob>Copy-All</lastJob>
<lastConnection startdate="2005-05-10" starttime="12:43:23" enddate="2005-05-10" endtime="12:58:32" />
<state>1</state>
</connection>
</farm>
</farm-config>
</root>
regards
sanjeev
|
|
|
|
|
What about:
private void button6_Click_1(object sender, System.EventArgs e)
{
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load("c:/farm-config.xml");
XmlElement farmelement = xmldoc.CreateElement("farm");
XmlElement farmConfig = xmldoc.SelectSingleNode("//farmConfig");
xmldoc.InsertAfter(farmelement,farmConfig);
FileStream fsxml = new FileStream("c:/farm-config.xml",FileMode.Truncate,FileAccess.Write,FileShare.ReadWrite);
xmldoc.Save(fsxml);
}
[not tested]
hope it helps,
David
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
Hi all,
I need to serialize and deserialize complex elements that have attributes, and get their values as well.
An example xml snippet:
<root version="1.0" rating="1">
<tempsettings>
<setting name="blah1" istemp="False">99
<setting name="blah2" istemp="True">100
<root> contains a <tempsettings> which has an ArrayList of
<setting> that is converted to a typed array when accessed via a property.
The problem I'm running into is along with access to <setting>'s
attributes I need the values contained in them as well. (eg. 99, 100).
I've been fuddling around for days and can't come up with how to do this.
I can't use the xsd generator to generate my c# class as my xml root
is stuck to being "root" and contains additional attributes.
Is there a way I can achieve what I need using .NET XML
serialization?
I sincerely appreciate any feedback.
|
|
|
|
|
|
argh! sorry for the last post forgot to escape my tags...
<root version="1.0" producer="1">
<exportSettings>
<setting name="folder1" isBatchdefs="False">99</setting>
<setting name="folder2" isBatchdefs="True">100</setting>
</exportSettings>
</root>
|
|
|
|
|
david,
thanks for catching my page errors.
due to formatting errors with previous posts please let me restate my problem:
<root version="1.0" producer="1">
<exportsettings>
<setting name="folder1" isbatchdefs="False">99
<setting name="folder2" isbatchdefs="True">100
The problem I'm running into is along with access to <setting>'s
attributes I need the values contained in them as well. (eg. 99, 100).
I can't use the xsd generator to generate my c# class as my xml root
is stuck to being "root" and contains additional attributes.
Thanks for your comments and feedback!
|
|
|
|
|
that wasn't very lucky... there are still missing things in the text... check "Do not treat <'s as HTML tags" and post it (original post) one more time... please
thanks,
David
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
<root version="1.0" producer="1">
<exportSettings>
<setting name="folder1" isBatchdefs="False">99</setting>
<setting name="folder2" isBatchdefs="True">100</setting>
</exportSettings>
</root>
<root> contains an <exportSettings> which has an ArrayList of
<setting> that is converted to a typed array in the property field.
The problem I'm running into is along with access to <setting>'s
attributes I need the values contained in them as well. (eg. 99, 100).
I can't use the xsd generator to generate my c# class as my xml root
is stuck to being "root" and contains additional attributes.
Sorry I've been up for the past 36 hours and my mind is a little saggy bloated feeling.
Thanks for your comments and feedback!
|
|
|
|
|
I am quite confused... it doesn't look like typical XmlSerializer stuff. Maybe I am missing something? (does it show I don't know much about serialization? )
Maybe take a look at XmlElementEventHandler Delegate[^]. What I think is that if it doesn't deserialize automaticaly you can handle <exportsettings> in event handler (see link)... you have access to readed Element ... and it's XmlElement.InnerText value, which is exactly what you need.
hope it helps
p.s you may consider to get the CP login - at least for ability to delete/modify your posts
David
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
HI,
I need to get the value of Address from XMl file(address="192.180.1.0")
Pls tell me the XPATH for Retriveing value of Address
I also need the valie of lastjob
How should i do validation the Attribute values from XML file
Because there can be multiple entries How can selecte particular node
suppose i want to select comnnection node whose address="192.180.1.0"
What will be XPath for that
Fomat of this file is as given below
-----------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8" ?>
- <root>
- <farm-config>
- <farm name="dev1">
- <connection address="192.180.1.0" user="ohm" selectedConnection="1" password="sanjeev">
<lastJob>Copy-All</lastJob>
<lastConnection startdate="2005-05-10" starttime="12:43:23" enddate="2005-05-10" endtime="12:58:32" />
<state>1</state>
</connection>
- <database state="0" name="bd_house1" sourceType="Monkey">
- <tables state="0" name="CAT">
<columns state="0" name="DATE" />
<columns state="0" name="TIME" />
<columns state="0" name="DAY" />
<columns state="0" name="MONTH" />
<columns state="0" name="YEAR" />
<columns state="0" name="PRODWEEK" />
<columns state="0" name="PRODDAY" />
<columns state="0" name="WEEKDAY" />
<columns state="0" name="SILO" />
<columns state="0" name="CAR" />
<columns state="0" name="PRODUCT" />
<columns state="0" name="VOLUME" />
</tables>
- <tables state="0" name="DOG">
<columns state="0" name="DATE" />
<columns state="0" name="TIME" />
<columns state="0" name="DAY" />
<columns state="0" name="MONTH" />
<columns state="0" name="YEAR" />
<columns state="0" name="PRODWEEK" />
<columns state="0" name="PRODDAY" />
<columns state="0" name="WEEKDAY" />
<columns state="0" name="SILO" />
<columns state="0" name="CAR" />
<columns state="0" name="PRODUCT" />
<columns state="0" name="VOLUME" />
</tables>
</database>
</farm>
</farm-config>
</root>
Regards
sanjeev
|
|
|
|
|
XSL:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method = "text" />
<xsl:template match="/">
<xsl:for-each select="root/farm-config/farm/connection">
Last-Job: <xsl:value-of select="lastJob" />
IP Address: <xsl:value-of select="@address" />
Start: <xsl:value-of select="lastConnection/@starttime" />
End: <xsl:value-of select="lastConnection/@endtime" />
End-Date: <xsl:value-of select="lastConnection/@enddate" />
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
RESULT:
Last-Job: Copy-All
IP Address: 192.180.1.0
Start: 12:43:23
End: 12:58:32
End-Date: 2005-05-10
|
|
|
|
|
Sorry, forgot to mention:
instead of:
<xsl:for-each select="root/farm-config/farm/connection">
You could also use:
<xsl:for-each select="//connection"> (which will match all connection nodes anywhere in the document)
Hope this helps
|
|
|
|
|
ALSO - to match only nodes with address attribute of 192.180.1.0:
<xsl:for-each select="root/farm-config/farm/connection[@address='192.180.1.0']">
or
<xsl:for-each select="//connection[@address='192.180.1.0']">
|
|
|
|
|
ALSO - to match only nodes with address attribute of 192.180.1.0:
<xsl:for-each select="root/farm-config/farm/connection[@address='192.180.1.0']">
or
<xsl:for-each select="//connection[@address='192.180.1.0']">
|
|
|
|
|
I need a program that will run on a server that will be sitting idle waiting for a website to send it an xml file. when the xml file gets sent to the server I need to parse the xml file and insert some of the data into a oracle database.
The program needs to be a http listener.
the xml file will be small.
Where do I start for making this program?
Does anyone know if Oracle has a function like this built into it?
Thanks all.
|
|
|
|
|
I am new in XML and XSLT. I have got a problem where i have to convert flat records into hierarchial records.
I have an XML containing the following records
<Data>
<Record>
<Id>1</Id>
<Name>something1</Name>
<Level>0</Level>
</Record>
<Record>
<Id>2</Id>
<Name>something2</Name>
<Level>1</Level>
</Record>
<Record>
<Id>3</Id>
<Name>something3</Name>
<Level>1</Level>
</Record>
<Record>
<Id>4</Id>
<Name>something4</Name>
<Level>2</Level>
</Record>
<Record>
<Id>5</Id>
<Name>something5</Name>
<Level>0</Level>
</Record>
</Data>
Now this data has to be arranged in the following manner
<Data>
<Record Id="1" Name="something" Level="0">
<Record Id="2" Name="something2" Level="1"></Record>
<Record Id="3" Name="something3" Level="1">
<Record Id="4" Name="something4" Level="2">
</Record>
</Record>
</Record>
<Record Id="5" Name="something" Level="0">
</Record>
</Data>
the level will decide how much recursion dept will be there.
Can anyone please help me with the XSLT transformer for this problem.
Thanks
Maharishi
Nothing is Impossible. Even impossible spells "i m possible"
|
|
|
|
|
If I have to display selected bytes of a file in XML. How do i do it???
If the data which is read as array and has to be displayed in XML how do i make it possible???
Prakash khatri
|
|
|
|
|
errr what please?? First you must understand that XML is language... you have to define your format for it... there is infinite number of ways how to represent bunch of bytes in XML... Plus XML is textual format... are you sure XML is right choice for your problem? And what do you mean by "display"? XML doesn't define how data look.
I can think of some solutions, bun actually I have no idea what you want:
<data>blablba meaningless bytes here (encoded!!)</data>
"Display" array means have more elements...
<array>
<array_item />
<array_item />
<array_item />
<array_item />
</array>
Or what are you asking??
Sure I can tell you how actual code for writing this XML looks like... at least in .NET.
David
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
I am new to XML, and am having trouble switching back and forth between c# and XML. The foreach loop is not functioning as I would expect. I have a foreach loop inside of another foreach loop. My goal was to say for each step, grab the name and block from each parameter in that step. Instead, it grabs all the step names, then all the parameter info. Is there a child nodes only type function for the for each loop?
Here is a sample from my XML:
<STEP NAME="First step" ID="2" TYPE="CalibrateSPS">
<PARAM>
<NAME>Cal sps 1</NAME>
<BLOCK>153</BLOCK>
</PARAM>
<PARAM>
<NAME>Cal sps 1</NAME>
<BLOCK>153</BLOCK>
</PARAM>
<PARAM>
<NAME>Cal sps 1</NAME>
<BLOCK>153</BLOCK>
</PARAM>
</STEP>
<STEP NAME="another step" ID="2" TYPE="CalibrateSPS">
<PARAM>
<NAME>Cal sps 1</NAME>
<BLOCK>153</BLOCK>
</PARAM>
<PARAM>
<NAME>Cal sps 1</NAME>
<BLOCK>153</BLOCK>
</PARAM>
<PARAM>
<NAME>Cal sps 1</NAME>
<BLOCK>153</BLOCK>
</PARAM>
</STEP>
Here is an excert from my xsl:
<xsl:for-each select="DOC/STEP">
<h3>Step Name: <xsl:value-of select="@NAME"/> </h3>
<xsl:for-each select="PARAM">
<tr>
<td><xsl:value-of select="NAME"/></td>
<td><xsl:value-of select="BLOCK"/></td>
</tr>
</xsl:for-each>
</xsl:for-each>
Thanks in advance
*****************
"We need to apply 21st-century information technology to the health care field. We need to have our medical records put on the I.T." —GW
|
|
|
|
|
I just ran your xml/xsl in cooktop and it gave me the correct result -
<!DOCTYPE h3 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<h3>Step Name: First step</h3>
<tr>
<td>Cal sps 1</td>
<td>153</td>
</tr>
<tr>
<td>Cal sps 1</td>
<td>153</td>
</tr>
<tr>
<td>Cal sps 1</td>
<td>153</td>
</tr>
<h3>Step Name: another step</h3>
<tr>
<td>Cal sps 1</td>
<td>153</td>
</tr>
<tr>
<td>Cal sps 1</td>
<td>153</td>
</tr>
<tr>
<td>Cal sps 1</td>
<td>153</td>
</tr>
------
I did not see the DOC element in your xml - so the only change I made is:
<xsl:for-each select="//STEP">
To me your loops should work the way you want!
|
|
|
|