|
I have problem about xslt command
I retreive data form xml with xslt and add textbox/checkbox/textarea for receive data form user, and I want to use this data to calculate and save in another xml file , how I write the xslt command
I use asp.net with vbscript
Thank for help
|
|
|
|
|
XSLT accepts parameters, and passing them in via VB.NET is very easy. Here's an example from my code:
XsltArgumentList xsltArgs = new XsltArgumentList();
xsltArgs.AddParam("id", "", this.ClientID);
xsltArgs.AddParam("seldata", "", this.SelectedNodeData);
xsltTree.Transform(xData, xsltArgs, output, null);
If you look up the AddParam command in MSDN, you'll see the XSLT examples you need.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I have an application which ran fine under windows 2000. It is browser based and uses XMLTransform. The Authentication requirment is that the user must be either integrated or Digest (anonyomous is not allowed).
When I try to run the browser pages I get an error from xmltransform indicating that the rights are not correct. The probelm is even though I enter my user name and password to be authenticated, the program reports that I am accessing as :Authentication anonymous. A request.ServerVariables("AUTH_USER") reports blank (anonymous).
I have everything configured the same as on the windows 2000 machine as far as IIS only allowing integrated access yet I is not happening and the application control pages all .asp do not come up. Anonymous access is not allowed anywhere on the server yet this is continual.
Any Ideas?
Jan Michael
|
|
|
|
|
hi,
These contents i want to insert after farm elements where farm is equal to dev2
here is syntax of node element which i want to insert
<database state="0" name="one" sourceType="amacs">
<database>
I want Xml(database) to be inserted after farm where farm is equal to "dev2"
I am giving you the structure 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>
<database state="0" name="bd_plc1_house1_14022005" sourceType="amacs">
<tables state="0" name="feed_delivery">
</table>
</database>
</farm>
<farm name="dev2">
<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 have the code pls anybody can modify it
This code is giving an syntax error
xmldoc.DocumentElement["farm name='dev2'"].PrependChild(databaseElement);
regards
sanjeev
|
|
|
|
|
Most likely cause of an error is that
ksanju1000 wrote:
xmldoc.DocumentElement["farm name='dev2'"].
is returning null. Given that you don't tell us the error ( despite asking this several times), I have to guess.
Assuming that farm name='dev2' is an XPath, you need //farm in order to find the node, unless you're at the level directly above it. Also, I believe that @ is required to show that you're matching a property in the node, but I am both rusty on XML, and quite sick at the moment, so I could be having a bad hair moment there.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian's 99% of the way there (if you *are* using XPath...)
The syntax you want is:
xmldoc.DocumentElement["//farm[@name='dev2']"].PrependChild(databaseElement);
HTH!
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
Hi
This path gives syntax error(Object reference not found)
can you again try
xmldoc.DocumentElement["//farm[@name='dev2']"].PrependChild(databaseElement);
This does not work
|
|
|
|
|
Hello all,
I'm trying to take an XMLnode (found with .SelectSingleNode()) from one document and copy it into another document. I keep gettting an error message that they are not the correct type. Anyone have some examples of the .clone function in VB.net 2005??
Thanks, Jeff
|
|
|
|
|
jeffb_ wrote:
VB.net 2005
I don't know how in 2k5, let be alone in VB... In good ol' .NET1.1 XML elements art in "document context" so elements can be used only within XmlDocument which created them.
(Just checked, work same way in .NET 2.0)
Well XmlNode ( so XmlElement too ) implements ICloneable . Should not be a problem.
David
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
Hi
I am trying to generate a XSD schema from a xml file by using a stream writer.
I created a dataset and read XML into that dataset.
Now I am trying the ds.WriteXmlSchema();
Actually it works correctly...but my issue is I want to send the written schema into a textbox on button click.
How would I do that?
This is the code I wrote for writing the schema:
System.IO.StreamWriter swXML= new System.IO.StreamWriter();
ds.WriteXmlSchema(swXML);
textBox1.Text =swXML.ToString();
|
|
|
|
|
|
Hi
I am using msxmlcpp library that was written by Sven Weigand. With this library
I parse an xml file. When one of my methods ends I receive an Access violation message
box. With debugging I have seen that it happens as a result of CXMLDOMNode class's destructor.
As a result of the destructor an ATL's CComPtr->Release method is called and it causes this
problem. Does anybody know how to solve thid problem?
Best regards
|
|
|
|
|
|
Hi
my program updates only farm name I want to search through loop farm name and it should
update address,
user and password from the existing file name
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load("c:/farm-config.xml");
XmlNode farm=xmldoc.SelectSingleNode("/root/farm-config/farm/@name");
MessageBox.Show(farm.InnerText);
farm.InnerText="devxcv1";
MessageBox.Show(farm.InnerXml);
xmldoc.Save("c:/farm-config.xml");
My XMl strucutrue is as given below
<?xml version="1.0" encoding="UTF-8"?>
<root>
<farm-config>
<farm name="sanjay">
<connection address="127.0.0.1" user="dog" password="cat">
<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 name="ram">
<connection address="localhost" user="root" selectedConnection="1" password="daask">
<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>
--- supoose i want to find thr loop ram and i want o change address,user and password attribues value thr loop
if i change it changes the upper ones farm name=sanjay 's address,user and password
regards
sanjeev
|
|
|
|
|
Could you re-formulate this? In sentences maybe? Sorry, but I have hard time to understand what you have and what you want...
Maybe example of expected result could help. (?)
David
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
Hi buddy,
I have already implemented. Actually it searches the particular node from xml file and update child's node atrribute
Thanks for your interest
regards
sanjeev
|
|
|
|
|
Hello all!
I'm using ASP.NET and XML and sql server database.
I get daily updates in xml format and import them into the MSSQL DB.
I do this via a function in ASP.net using XmlReader.
The problem is that i have to do it manually!
Each morning i goto the asp.net website and click "get xml updates".
Is there any way to automate this procedure?
thanks guys
|
|
|
|
|
You Can use windows service for this.You can shedule your specific task like sending xml file to server by using ur service .You can start with it.
regards
sagar
|
|
|
|
|
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
|
|
|
|