|
Hi
I am working on ASP.NET, i have data both for XML and XSL stored in oracle 10g database
I have a dataset which (will eventually be the XML)
I laso have data from output cursor which is the XSL, now can i pass the dataset as a xsl like i pass Dataset for a XML file? how do i acheive it
If not how to transfer the XSL data to a physical file and then i can use to transform.
sss
|
|
|
|
|
Hello,
We are building a windows desktop application using C#
that reads in an xml file, to create a user interface.
The user then enters values into the user interface.
We want to be able to save an xml file with the same
schema as the original xml file, but with the users
entered values into it.
Here is a simple example as part of input document:
<label>
<name>Needs Cleaning</name>
<type>radio</type>
<value>
<choicelist>yes</choicelist>
<choicevalue></choicevalue>
<choicelist>no</choicelist>
<choicevalue></choicevalue>
</value>
</label>
We would want the output document to contain:
<label>
<name>Needs Cleaning</name>
<type>radio</type>
<value>
<choicelist>yes</choicelist>
<choicevalue>yes</choicevalue>
<choicelist>no</choicelist>
<choicevalue></choicevalue>
</value>
</label>
or perhaps
<label>
<name>Needs Cleaning</name>
<type>text</type>
<value>
<single>yes</single>
</value>
</label>
We aren't too adept at xmlTextReaders and xmlTextWriters yet,
and have been doing some research in Google.
There was an interesting article that seemed pertinent to this, but
it dealt with C++ :
http://www.codeproject.com/csharp/dcinsertxml.asp
Any help would be appreciated.
Thank you!
Anne
|
|
|
|
|
|
|
Lookup usage of the "innerxml" property of the entry elements when recieving the returned data.
"Every new day begins with possibilities. It's up to us to fill it with things that move us toward progress and peace.” (Ronald Reagan)
|
|
|
|
|
Hi
Any one know how to validate xsd to xml in vbscript. Is it possible. If it possible, can i check each node while entering the data. for example i have 2 child element like customerid, customername, while entering customerid it check wether entered data is numeric. can i get any exception or parser error if user enter wrong data.
Can any one tell how i can transfer server side xml data to client side. I expect better ideas from members
Regards
Maxi
maximasshel@hotmail.com
Maximasshel
|
|
|
|
|
hope u have done with this problem yet but for ur help u can chk this Vb code below:
Set schemaCache = New MSXML2.XMLSchemaCache40
Dim doc As MSXML2.DOMDocument40
Dim xsd
Set doc = New MSXML2.DOMDocument40
xsd = RTReg.getValue("xsd_path")
schemaCache.Add "", xsdpath 'Check the file with xsd
Set doc.schemas = schemaCache 'add schema with the file
doc.async = False
If Not doc.Load(sOutputFile) Then
'XML file not parsed
Else
'successfully parsed
End If
Sushant Mathur
Bangalore,
INDIA.
http://n.domaindlx.com/fun2ssh/HOME.htm
|
|
|
|
|
I have a fairly large XML schema. I built it with the schema editor in Visual Studio 2005. It contains everything needed to build the corresponding database in SQL (keys, relationships, etc). I expected to be able to use the schema to build the database structure but have not been able to discover how it is done. I have seen that you can use the schema to build a dataset, but I need to build the actual tables and relations in the database.
If you import a schema with MS Aceess, it will build the tables but does not seem to get the data types right. If Access can do it, I assume that SQL could also. Has anyone every done something like this? Thanks, Michael
|
|
|
|
|
Ok, I wasn't sure what board to put this so I am shooting here first as it is a c# code question:
I have the following XML Data that is returned from a 3rd party API. The resulting data is stored as a string and loaded into the XML dom as follows:
// s_invoices contains the XML
string s_invoices;
XmlDocument doc = new XmlDocument();
doc.InnerXml = s_invoices;
XmlElement root = doc.DocumentElement;
The XML itself looks like the following (sample):
<?xml version="1.0" encoding="UTF-8"?>
<Order_Invoice_Outgoing_Array_Element>
<Order_Invoice_Outgoing_Element>
<interface_transaction>18399</interface_transaction>
<transaction>18399</transaction>
<order_Invoice_Header>
<vendor>P00621</vendor>
<invoice>90951282</invoice>
<currency>USD</currency>
<invoice_Category>ORDER</invoice_Category>
<invoice_Date>2003-08-18T00:00:00.000-04:00</invoice_Date>
<invoice_Due_Date>2003-0818T00:00:00.00004:00</invoice_Due_Date>
<terms>NET30</terms>
<invoice_Amount_Total>6260</invoice_Amount_Total>
<status>CLOSED</status>
<currency_Exchange_Rate>1</currency_Exchange_Rate>
<order_Type_Optional>PO</order_Type_Optional>
<order_Number_Optional>40845</order_Number_Optional>
<pay_Indicator>AP</pay_Indicator>
<original_Invoice_Amount>0</original_Invoice_Amount>
<GL_Account>
<GL_Company>443120</GL_Company>
<GL_Expenditure>809</GL_Expenditure>
<GL>0</GL>
<GL_Cost_Center>0</GL_Cost_Center>
<GL_Description>REPAIR ORDERS</GL_Description>
<GL_Category>ALL</GL_Category>
<modified_By>GLACCOUNT</modified_By>
</GL_Account>
<voucher>78086</voucher>
<created_By>TGREEN</created_By>
<created_Date>2003-10-31T00:00:00.000-05:00</created_Date>
<modified_By>PFAPHSTN</modified_By>
<modified_Date>2006-03-19T00:00:00.000-05:00</modified_Date>
<line_Sum>6260</line_Sum>
<AP_System_Received_Flag>false</AP_System_Received_Flag>
<paid_Flag>true</paid_Flag>
<interface_Batch>14975</interface_Batch>
</order_Invoice_Header>
<order_Invoice_Lines>
<order_Invoice_Line>
<order_Type>PO</order_Type>
<order_Line>7</order_Line>
<order_Number>40845</order_Number>
<invoice_Category>ORDER</invoice_Category>
<invoice_Date>2003-08-18T00:00:00.000-04:00</invoice_Date>
<invoice_Amount>6260</invoice_Amount>
<invoiced_Qty>1</invoiced_Qty>
<GL_Account>
<GL_Company>443120</GL_Company>
<GL_Expenditure>809</GL_Expenditure>
<GL>0</GL>
<GL_Cost_Center>0</GL_Cost_Center>
<GL_Description>REPAIR ORDERS</GL_Description>
<GL_Category>ALL</GL_Category>
<modified_By>GLACCOUNT</modified_By>
</GL_Account>
<status>CLOSED</status>
<assigned_To>VHAINES</assigned_To>
<credit_Memo>78086</credit_Memo>
<credit_Memo_Cost>0</credit_Memo_Cost>
<original_Invoice_Amount>0</original_Invoice_Amount>
<created_By>TGREEN</created_By>
<created_Date>2003-10-31T00:00:00.000-05:00</created_Date>
<modified_By>PFAPHSHD</modified_By>
<modified_Date>2006-03-19T08:39:39.000-05:00</modified_Date>
<line_Amount>6260</line_Amount>
</order_Invoice_Line>
</order_Invoice_Lines>
</Order_Invoice_Outgoing_Element>
</Order_Invoice_Outgoing_Array_Element>
So basically it is a very convoluted XML string. Now what I want to do is populate the XML into a form but am having problems finding what I am looking for.
I am currently using the following:
Console.WriteLine(" The terface_transaction : {0}", root.GetAttribute("//Order_Invoice_Outgoing_Array_Element/Order_Invoice_Outgoing_Element/interface_transaction"));
To try to write out just the interface transaction portion of the XML but alas it is not working. I am thinking it is because maybe GetAttribute is set to start at root and somehow my pathing is wrong, any ideas?
-- modified at 11:22 Tuesday 18th April, 2006
|
|
|
|
|
// s_invoices contains the XML
string s_invoices;
XmlDocument doc = new XmlDocument();
doc.LoadXml(s_invoices);
string xpath =
"/Order_Invoice_Outgoing_Array_Element" +
"/Order_Invoice_Outgoing_Element" +
"/interface_transaction/child::text()";
XmlElement root = doc.DocumentElement;
XmlText interface_transaction =
(XmlText)root.SelectSingleNode(xpath);
if (interface_transaction != null)
{
Console.WriteLine(interface_transaction.Value);
}
Please note that "interface_transaction" is an element node not an attribute node.
|
|
|
|
|
Hi
I am developeing a web application in asp.net using vb.net and vbscript. In this I need XML data manipulation from server side to client side. I get data from Serverside ie
/*
txtXML= ds.getxml() 'here txtXML is hidden text box.
*/
and in client side
/*
strXML= document.Form1.txtXML.value
set objXMLDoc= CreateObject("Microsoft.XMLDom")
objXMLDoc.async= "false"
objXMLDoc.loadXML(strXML)
set ElementList = objXMLDoc.getElementsByTagName("Customers")
for i=0 to ElementList.length - 1
set objElementChild= ElementList.item(i).childnodes.item(1)
MsgBox objElementChild.text
next
*/
Here the problem is user can view all the xml data stored in the hidden text box. If he right click web page and click view source, he can view whole xmldata. I want to hide these data from user, and dont want to store any wehre else in the physical location.
Can i directly access any node from xml file ie parent node or child node or its attribute.
Please help me... with example project.
<NewDataSet>
<Customers id="001">
<Name>
<Fname>Maximas</Fname>
<Lname>Shel</Lname>
</Name>
<Sex>Male</Sex>
</Customers>
........
........
</NewDataSet>
can i access/ search any node from this xml like (fname,sex) and manipulate lname or sex for particular node.
Please help me... it is very urgent... i am in big trouble.....
Maximasshel
|
|
|
|
|
Does it have to be done on the client side in this fashion?
|
|
|
|
|
hi,
yes, i need it in client side, you can do it in your on ways both in server and client side(above specified code is just an example). We are using a client grid and it doesnot require posting. The reason is that loading thousands of data in each posting is difficult. Now i am maintaing a string and populate client grid from that string. And based on this string i am doing various operation like add,edit,search, grouping etc. Now i came to know that xml data manipulation is easier than string manipulation.
So i need solution in client side. Just i tried transfer xml data from server to client side using hidden text box. but user can able to view the whole data. I dont want alow this.
If any one know the solution pls help me.
If there is any better way of populating and transfering xml data to client side is also acceptable.
Maximasshel
|
|
|
|
|
You can place your XML document on the web server and access it as follows:
<xml id="customer_id" src="http://www.codeproject.com/xmlFile.xml"></xml>
|
|
|
|
|
Hi All
I have both the XML and XSL files named: SummarizedLedgerReport.xml, SummarizedLedgerReport.xsl
I need to know how to convert these two files to PDF using FOP(Formatting Objects Processor). I'v read up on it but i'm still not shure how to go about it.
Any advice is more then welcome
|
|
|
|
|
i am using the following code to select rows in xml with a condition name = strVar:
"/accounts/account[name='"+strVar+"']/name"
my problem is,
how can i select rows with condition that name date is like strVar,
in SqlServer i use "select * from account where name like '%"+strVar+"%', but i ont know how it work with XML.
sultan
|
|
|
|
|
XPath has a few functions that may help:
contains - Returns true if the first argument string contains the second argument string; otherwise returns false.
starts-with - Returns true if the first argument string starts with the second argument string; otherwise returns false.
substring - Returns the substring of the first argument starting at the position specified in the second argument and the length specified in the third argument.
substring-after - Returns the substring of the first argument string that follows the first occurrence of the second argument string in the first argument string.
substring-before - Returns the substring of the first argument string that precedes the first occurrence of the second argument string in the first argument string.
string-length - Returns the number of characters in the string.
Example:
"/accounts/account[contains(name,'" + strVar + "')]/name"
Another option is to select all of the "account" nodes and then filter out unwanted selected nodes using regular expressions or string funtions in your favorite managed or unmanaged language.
|
|
|
|
|
Dear Mr George L. Jackson,
Thanks alot for your help, its exactlly what iam looking for and its work well.
Sultan
|
|
|
|
|
If i whant to search in more than one field in the same expression for ex:
i want to find the name of persons where they have middle name like 'Var1' and jobname like 'Var2'
So how can i use the apove expression ?
Sultan
|
|
|
|
|
You can use the "and", "or" or "not()" operators.
Example:
"/accounts/account[contains(middle,'" + Var1 + "') and contains(jobname,'" + Var2 + "')]/name"
Of course, you will have to use the appropriate XPath function to do the proper search.
|
|
|
|
|
dear George L. Jackson
I unable to thank you as due,
and in the end thank you very much.
sultan
|
|
|
|
|
I've used simple XSLT to convert XML to a web page but now I wonder how far can I go. That's why I want to ask a few questions what is possible.
Is it possible to create a full web site just using XML?
I want the transformations to occur on the server if possible. How can I do it. I have no idea at all. I have probably PHP support on the server (I'm not quite sure) but I can neither program it nor I want to learn it (except very basic stuff if needed) due to time constraints.
My goal is to create a web catalog that I feed with XML files about each product and images and they are displayed in particular order. So when I want to change something I just upload a new XML file or image. That's all. The goods won't be too many, maybe just a couple of hundereds or even much less.
Is this possible to create with XML/XSL/XSLT?
Which good modern book do you recommend me to read about that topic?
Thank you very much!
|
|
|
|
|
Cristoff wrote: Is it possible to create a full web site just using XML?
Yes and No.
You can define the content. But as you point out, it does need some xsl/xslt processing.
Cristoff wrote: but I can neither program it nor I want to learn it
I will say a big problem. Developing good xslt is programing really. (Or call it another art form.)
Your issue is what enviroment do you want to use. If you are serious that you do not have time. Then I think that is your answer, you do not have time. Really depends on what you call basic stuff.
Cristoff wrote: Is this possible to create with XML/XSL/XSLT?
Yes, very much so. Now which option to you want and what constraints do your clients force upon you?
Do a search on AJAX, and Apache Cocoon for some options. Now my guess is you do not have time for either. So what are you comfortable developing dynamic pages now? Select it, add xml processing and generate the basic pages just as you always have. Then add the content by getting the values of the xml element content from either the DOM or SAX models (for small and simpler to understand probably the DOM)
"Every new day begins with possibilities. It's up to us to fill it with things that move us toward progress and peace.” (Ronald Reagan)
|
|
|
|
|
I have to clarify a few things here first. I hope I'll succeed. I want to help you help me!
Michael A. Barnhart wrote: Cristoff wrote:
Is it possible to create a full web site just using XML?
Yes and No.
Michael A. Barnhart wrote: but I can neither program it nor I want to learn it
I will say a big problem. Developing good xslt is programing really. (Or call it another art form.)
I don't want to learn PHP but the server supports only PHP and MySQL. I'd rather use ASP.NET but it is not available.
I want to learn XSLT. My concern is if just XSLT and all other XML techs are enough for the job.
I know that IE 6, Firefox etc. have full support of XML, XSLT etc. so they can do the processing on the client side but I also want the site to be viewed by older browser so I need to process the date on the server. I just have no idea what is needed for the job. A special server or to program the processing in PHP, ASP.NET...
Michael A. Barnhart wrote: Your issue is what enviroment do you want to use. If you are serious that you do not have time. Then I think that is your answer, you do not have time. Really depends on what you call basic stuff.
Well, I don't want to learn PHP because that will be the first and the last project I'll ever do with it but I'll definitely have much more use just for XML/XSLT. I already have done a personal site with both technologies and it works fine (No you cannot view it, it is not on the web).
The site I'm working now is made mostly of static HTML pages + some JavaScript. I'm doing it with Dreamweaver. Once it is done I really have no time constraints to come up with a new version.
This time I would like to have all the data as XML that I can be created by another person manually.
Then when needed just the XML files are replaced without the need to change everything else (the way it is now).
If I had access to a server that supports .NET. I wouldn't have asked here at all.
|
|
|
|
|
Sounds like you are most of the way then. Assuming the arrangement of the page is basically static, you can output the html declarations (header and body wrapping elements) with either text output from PHP or the initial output from the xslt processing. Then you add the changing html (table rows, or what ever) via the matching loops you have with the xslt processing. The XSLT process does not have to output xml. You do not have to learn much php, just enough to read in the xml file and then start the xslt processing.
Cristoff wrote: If I had access to a server that supports .NET.
Same boat I am in right now. I have just about convinced myself to go with a different and more expensive service to add the capability.
"Every new day begins with possibilities. It's up to us to fill it with things that move us toward progress and peace.” (Ronald Reagan)
|
|
|
|