|
this is a piece of the xsl i use:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
<xsl:output omit-xml-declaration="no" method="xml" indent="yes" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" />
...
<input type="hidden" name="projectcode">
<xsl:attribute name="value">
<xsl:value-of select="../PROJECTCODE"/>
</xsl:attribute>
</input>
...
but when i render the xml using System.Xml.Xsl.XslTransform, the result is not valid xhtml. The hidden input is generated as:
<input type="hidden" name="projectcode" value="123"></input>
in stead of:
<input type="hidden" name="projectcode" value="123" />
does anyone have any idea what i am doing wrong??
|
|
|
|
|
Use the inline syntax for your attribute then you can have a closed tag element.
|
|
|
|
|
Thanks Chris!!
That did the trick!!
|
|
|
|
|
Hello all,
I am processing an XML file section appropriately (Individuals) . I have added elements (the Numbers section) to the XML File.
Below is the XML File Layout:
<Metrics>
<Numbers>
<Possible>13</Possible>
<Fail>0</Fail>
<Pass>7</Pass>
<Blocked>0</Blocked>
<NotRun>2</NotRun>
<TestBridgeID>43</TestBridgeID>
<VersionID>14</VersionID>
<Verified>0</Verified>
<Errors>4</Errors>
<Deleted>0</Deleted>
<RunDate>7/7/2004</RunDate>
</Numbers>
<Individuals>
<MultiLevelID>820</MultiLevelID>
<UIValues>
<Tab>Finishing</Tab>
<Control>Landscape</Control>
<Setting>ON</Setting>
<Disposition>1</Disposition>
<Reason>12</Reason>
</UIValues>
<UIValues>
<Tab>Finishing</Tab>
<Control>Landscape</Control>
<Setting>ON</Setting>
<Disposition>1</Disposition>
<Reason>12</Reason>
</UIValues>
</Individuals>
<Individuals>
etc. etc. etc.
Here is my code for processing the Individuals section.
private void ReadIndividualUI()
{
//Create a resolver with the necessary credentials.
XmlUrlResolver resolver = new XmlUrlResolver();
NetworkCredential nc = new NetworkCredential(ConfigurationSettings.AppSettings ["SecureLogin"], ConfigurationSettings.AppSettings["SecurePassword"]);
resolver.Credentials = nc;
// Get a Stream object containing the XML file.
Uri myUri = new Uri("http://Benningfield1/DataSetTest/SwattReporta.xml");
Stream s = (Stream)resolver.GetEntity(myUri, null, typeof(Stream));
// Construct a reader using the Stream object.
XmlTextReader xmlReader = new XmlTextReader(s);
//Process XML File accordingly
while(xmlReader.Read())
{
//Perform appropriate processing
}
Here is my pseudocode for what I need to do next.
Go To The Numbers element
Pull all values (from Possible element, FAil element etc.) into a memory storage area
Then process values accordingly
What is the best way to mesh what I want to do in Pseudocode with the current ReadIndividualUI() method functionality?
TYIA,
lonelobo
|
|
|
|
|
Is it possible to evaluate XPath expression whose return type is not a nodeset (non location expressions) on Windows CE platform?
Igor
|
|
|
|
|
Can any body plz favor me with the regular expression of Xml document?
|
|
|
|
|
Hi Seekhtar
I really cann't understand your request ..
what do u mean by "regular expression of Xml document" ?
May be I could help u
Good Luck
|
|
|
|
|
Although there does not seem to be too much traffic in here I'll give it a try anyway...
I would like to be able to merge two XML documents, in such a manner that one will override the other. I.e., there will be a "global" XML file that contains some generic data, and then a "local" XML file that contains data that overrides data found in the global file. The local file does not have to contain the exact same number of nodes as the global one, i.e. it may only contain the nodes that we are interested in overriding.
You may ask yourself "how can this be helpful?", one example could be a global file that contains various settings that are used in an application, including text strings that will be visible to the user, and then a local file that contains translation of these visible text strings to some other languge, but otherwise does not change the settings/data in any way. In this way it will be easy to localise this file (we might want to be able to translate into many languages) without having to maintain multiple copies of the settings file - one for each language.
What I'm curious about is if there is a simple way to accomplish this through any known tools. The overhead should preferably be small, i.e. I don't want to be forced to install some massive Java libraries for this task alone . The code we're currently using to load/save XML files uses the Microsoft XML Parser so anything that's available through that tool is OK. I'm also willing to take a look at some .NET components if they do the job nicely, since this code will be used in an environment that ensures that the .NET framework has been installed.
Mind you that there are some obstacles on the way, for instance if the files in question were to store a list of books (classic example) and we would like to display the name of each book in the correct language, then we could create two files:
global.xml:
<books>
<book id="1">
<name>Some book</name>
<author>John Doe</author>
</book>
<book id="2">
<name>Another book</name>
<author>Susanne Smith</author>
</book>
</books>
local.xml ( book names have been translated into Icelandic ) :
<books>
<book id="1">
<name>Einhver bók</name>
</book>
<book id="2">
<name>Einhver önnur bók</name>
</book>
</books>
where the local.xml file does not want to mess with the author names, and it must override the correct bookname based on the id's. Note that under some circumstances, xml nodes equivalent to the <book> node might contain more attributes (not just the "id" attribute), and the unique attribute isn't necessarily called "id".
So does anyone have a *simple* solution to this problem? Any pointers would be very much welcome.
Best regards,
Daniel
|
|
|
|
|
Yes it is possible, I have worked on many a project where xml files are merged.
Unfortunatly I don't think there is any generic tool that will just do it for you, they way I have seen it done, is that the global xml file is loaded into the dom using MSXML, and the local file is loaded into a seperate dom.
Then for each node in the local file, a select is run against the global dom, to see if that node already exists. If it does the value is either replaced if the node does not exist then it is added into the dom.
All of this can be done using microsofts MSXML, just means writing some code yourself.
|
|
|
|
|
Thanks for your reply, writing code that uses the MSXML DOM is exactly what I have done, I was only curious if maybe I had reinvented the wheel
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
The merging of two xml documents can be more easily and elegantly performed by using xslt. Here is a link that implements the same beautifully.
http://www.informatik.hu-berlin.de/~obecker/XSLT/#merge
Think of it as evolution in action
|
|
|
|
|
hai philip,
I have been repeatedly getting the above stated error as
microsoft vbscript runtime error '800a01a8' object required: objNode
I am calling XML,XSLT files from my ASP page.
whenever i am using selectsinglenode() method. i am getting this error.
please help me. My entire project has been stalled due to this error.
my xslt and xml files are good and are without any bugs
my asp page is as follows.
<%Response.Buffer = true
Function viewdetail(strXMLFile, strXSLFile, strID)
'Declare local variables
Dim objXML
Dim objXMLNode
Dim objXSL
'Instantiate the XMLDOM Object that will hold the XML file.
set objXML = Server.CreateObject("MSXML2.DOMDocument.4.0")
'Turn off asyncronous file loading.
objXML.validateOnParse=true
objXML.async = false
'Load the XML file.
objXML.load(strXMLFile)
'set objXMLNode = objXML.selectsingleNode("xml/data/row")
'Get the XML record that you wish to view by calling the
'SelectSingleNode method and passing in the e-mail address of the
'contact.
'Instantiate the XMLDOM Object that will hold the XSL file.
set objXSL = Server.CreateObject("MSXML2.DOMDocument.4.0")
'Turn off asyncronous file loading.
objXSL.async = false
'Load the XSL file.
objXSL.load(strXSLFile)
Response.Write(objNode.transformNode(objXSL))
'Use the "transformNode" method of the XMLDOM to apply the XSL
'stylesheet to the XML document. Then the output is written to the
'client.
End Function
strID=Request.QueryString("au_id")
viewdetail server.MapPath("data.xml"),server.MapPath("adoxsltdup1.xslt"),strID
%>
with regards,
chaitanya
many thanks to those u solve my problem
|
|
|
|
|
hai philip,
I have been repeatedly getting the above stated error as
microsoft vbscript runtime error '800a01a8' object required: objNode
I am calling XML,XSLT files from my ASP page.
whenever i am using selectsinglenode() method. i am getting this error.
please help me. My entire project has been stalled due to this error.
my xslt and xml files are good and are without any bugs
my asp page is as follows.
<%Response.Buffer = true
Function viewdetail(strXMLFile, strXSLFile, strID)
'Declare local variables
Dim objXML
Dim objXMLNode
Dim objXSL
'Instantiate the XMLDOM Object that will hold the XML file.
set objXML = Server.CreateObject("MSXML2.DOMDocument.4.0")
'Turn off asyncronous file loading.
objXML.validateOnParse=true
objXML.async = false
'Load the XML file.
objXML.load(strXMLFile)
'set objXMLNode = objXML.selectsingleNode("xml/data/row")
'Get the XML record that you wish to view by calling the
'SelectSingleNode method and passing in the e-mail address of the
'contact.
'Instantiate the XMLDOM Object that will hold the XSL file.
set objXSL = Server.CreateObject("MSXML2.DOMDocument.4.0")
'Turn off asyncronous file loading.
objXSL.async = false
'Load the XSL file.
objXSL.load(strXSLFile)
Response.Write(objNode.transformNode(objXSL))
'Use the "transformNode" method of the XMLDOM to apply the XSL
'stylesheet to the XML document. Then the output is written to the
'client.
End Function
strID=Request.QueryString("au_id")
viewdetail server.MapPath("data.xml"),server.MapPath("adoxsltdup1.xslt"),strID
%>
with regards,
chaitanya
|
|
|
|
|
I need to feed records one at a time from SQL server to a vendors SOAP API and also be able to receice a record back as a seperate process via SOAP and place it into a different SQL table. The vendor transmitts an account number to me that then becomes part of the filter for what information I must send to them.
TO ME:
Vendor - SOAP - SQL Account Table
SQL Detail Table - SOAP - Vendor
...I think that's generic enough
Any ideas on the best way to accomplish this? Is a web service the right solution? I am looking to only use T-SQL and C#.
Thanks in advance for any help!
Craig
|
|
|
|
|
Im working on this program, and for some reason, I keep getting this error, but I dont understand how to fix it.
Here's the error:
A name was started with an invalid character. Error processing resource 'file:///C:/Documents and Settings/omar/Desktop/stp2.xml'. Line 2, Position 19
------------------^
and heres a copy of my code:
http://sourcepost.sytes.net/sourceview.aspx?source_id=15819
please help, thanks!
|
|
|
|
|
Hi osal ..
your problem - I think -
is, that you wrote a comment with a wrong syntax
so the right statement is like this ...
Good Luck
plz if I where wrong tell me the right statement after that..
|
|
|
|
|
Anyone available to help me out..it's a XML and XSL assignment..!! uregntly needed!!
|
|
|
|
|
|
hi
i am writing an application which maintains records of several clients. Each client has different settings. This is maintained in a XML file. When the user wants to update the data of a particular client changes have for that client.
this is what my XML document looks like.
<?xml version="1.0" encoding="UTF-8"?>
<config>
<client name="Cadbury">
<mcastg>222.23.342.1</mcastg>
<port>2222</port>
<path>c:\</path>
<repeat>4</repeat>
<spawn>4</spawn>
<ttl />
<profile>Custom</profile>
<custom>
<bw>1200</bw>
<dgsize>1024</dgsize>
</custom>
</client>
<client name="dabur">
<mcastg>222.23.432.23</mcastg>
<port>3333</port>
<path>d:\</path>
<repeat>5</repeat>
<spawn>5</spawn>
<ttl>4</ttl>
<profile>High</profile>
<custom>
<bw />
<dgsize />
</custom>
</client>
<client name="Vineet Inc">
<mcastg>222.23.43.4323</mcastg>
<port>5555</port>
<path>e:\</path>
<repeat>10</repeat>
<spawn>1</spawn>
<ttl>4</ttl>
<profile>Low</profile>
<custom>
<bw />
<dgsize />
</custom>
</client>
<client name="ICICI">
<mcastg>223.533.456.234</mcastg>
<port>54334</port>
<path>e:\hello</path>
<repeat>10</repeat>
<spawn>45</spawn>
<ttl>4</ttl>
<profile>Low</profile>
<custom>
<bw />
<dgsize />
</custom>
</client>
<client name="Vikram">
<mcastg>223.533.456.234</mcastg>
<port>5433</port>
<path>d:\vineet</path>
<repeat>10</repeat>
<spawn>45</spawn>
<ttl>4</ttl>
<profile>High</profile>
<custom>
<bw />
<dgsize />
</custom>
</client>
</config>
say i want to edit the settings for ICICI, how do i do from within the executing program. please give proper code.
Thanks
|
|
|
|
|
I have tried to create a generic xsl template to render any MSSQL FOR XML RAW query into a HTML table with adjustable paging and sorting. I have managed to find out how to do each part on its own but I can't put them all together.
Does anyone know how or has anyone seen anything like this before.
JJ
Trying like crazy.
|
|
|
|
|
Hi everyone
My program writes the content of a database in a XML file depending on the user request.
The first time there are no problem, but when i try to rewrite the file with the new content this message appear : WriteStartDocument must be the first call.
This is the code i use to open/close the file :
public void Rewrite()
{
xWriter.WriteStartDocument(false);
xWriter.Formatting = Formatting.Indented;
}
public void CloseFile()
{
xWriter.WriteEndDocument();
xWriter.Flush();
xWriter.Close();
}
I also tried to call the WriteStartDocument only if the file doesn't exist, but in this case the next time (after the file is closed) when some WriteElement instruction is executed the error message is : The writer is closed.
How can resolve this?
Thank you.
|
|
|
|
|
Hi ,
I have an RDL file that I want to view over the web.
The best solution I found is to write a compiler/interperter (RDL->HTML). This is doable but complicated. My question is : is there support for RDL in php,asp,jsp or any other web lang/script for viewing RDL with a browser?
or does anyone have some samples that deal with RDL format?
|
|
|
|
|
Hi code guys!
I've developed a service Logins.asmx. I works fine in local IIS. but when I copy required files to web server. I gives the download dailog (open or save).
Pls tell me how to publish webservice to Web Server.
Thanks.
Time is a good teacher but unfortunately it kills all his students
|
|
|
|
|
Sounds like you don't have IIS configured for ASMX files. That is ASP.NET right? If so you should try that forum you might get more response in there.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
You need to install ASP.NET on the IIS Server. For that, you will need the .NET Framework runtime installed on the machine. After you install it, go to the following folder in the server:
C:\WINDOWS\Microsoft.NET\Framework\<framework version="">
Then run the following command line tool with params:
aspnet_regiis.exe -i -enable
After tool runs, reboot...
ASP.NET will be properly configured on the server!
Hope this helps!
~javier
"I don't suffer from insanity, I enjoy every minute of it." -- Unknown
|
|
|
|