|
Hello. I have the doc. representing the message. It consists of header and body and has the following structure:
<br />
<message><br />
<header>blah-blah-blah</header><br />
<body/><br />
</message><br />
Of course I can define all of these with xsd.
But the body element can only be of 1 of the following forms:
<br />
<body type="SIMPLE"><br />
<el1>string contents</el1> <br />
</body><br />
or
<br />
<body type="COMPLEX"><br />
<el2>int contents</el2> <br />
<el3>int contents</el3> <br />
</body><br />
I can define this with xs:group's, but without attribute restrictions. Unfortunately, groups can't include xs:attribute.
Any ideas how to define it with xsd?
|
|
|
|
|
Ok so I made an XML data sheet that works fine, but i know i will need the data. So i need to be able to make the XML display the correct info according to the id="" How do I do this?
script.js:
//parser start
var xmlDoc;
function loadXML(){
//load xml file
// code for IE
if (window.ActiveXObject)
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async=false;
xmlDoc.load("product_info.xml");
getmessage();
}
// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation && document.implementation.createDocument)
{
xmlDoc=document.implementation.createDocument("","",null);
xmlDoc.load("product_info.xml");
xmlDoc.onload=getmessage;
}
else
{
alert('Your browser cannot handle this script');
}
}
// Actual message maker
function getmessage()
{
document.getElementById("name").innerHTML=xmlDoc.getElementsByTagName("name")[0].childNodes[0].nodeValue;
document.getElementById("file_size").innerHTML=xmlDoc.getElementsByTagName("file_size")[0].childNodes[0].nodeValue;
document.getElementById("summary").innerHTML=xmlDoc.getElementsByTagName("summary")[0].childNodes[0].nodeValue;
document.getElementById("version").innerHTML=xmlDoc.getElementsByTagName("version")[0].childNodes[0].nodeValue;
}
//parser end
function dio(){
window.open("dio.html")
}
dio.html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="SHORTCUT ICON" href="images/logo_orig/info.ico" />
<script src="script.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Product Info</title>
</head>
<body onload="loadXML()" bgcolor="#fffacd" text="#000000" link="FF4500">
<center>
<h1>Product Information</h1>
</center>
<p>
<b><u>File Name: </u></b><span id="name"></span><br />
<b><u>File Size: </u></b><span id="file_size"></span><br />
<b><u>File Summary: </u></b><span id="summary"></span><br />
<b><u>File Version: </u></b><span id="version"></span><br />
</p>
</body>
</html>
product_info.xml:
<?xml version="1.0" encoding="iso-8859-1"?>
<products>
<download>
<name>Bustin' Blox</name>
<file_size>2 Mb</file_size>
<summary>Our version of Brick. Only One Level (Kinda Sucks)</summary>
<version>1.0.0</version>
</download>
</products>
|
|
|
|
|
|
Hi,
I want to fetch the soap envelope every time when I call the web service.
Currently I m passing the values in object and the object gets passed into the Web method. I need that Soap envelope what dot net internally generate to call this web service.
|
|
|
|
|
run your service in the browser and it'll display you its specification: all public methods and their call signatures
|
|
|
|
|
No...
this is not what I m looking for...
I am calling a web service by passing an object to the Web method. Now I want that soap envelope that .net generating internally.
|
|
|
|
|
i`ve a xml file name myxml.xml which is as follows:
<RPS>
<RP>
<Paper_title>abcd</Paper_title>
<Authors>
<Author>rony</Author>
<Author>tony</Author>
<Author>sony</Author>
</Authors>
<Journal_or_Conference>abcd</Journal_or_Conference>
</RP>
<RP>
<Paper_title>abcd</Paper_title>
<Authors>
<Author>dip</Author>
<Author>tom</Author>
<Author>adam</Author>
</Authors>
<Journal_or_Conference>abcd</Journal_or_Conference>
</RP>
<RP>
<Paper_title>abcd</Paper_title>
<Authors>
<Author>mark</Author>
<Author>tony</Author>
<Author>bruce</Author>
</Authors>
<Journal_or_Conference>abcd</Journal_or_Conference>
</RP>
</RPS>
i want to write a xsl file that makes the above xml file in tabular format as following:
Authors Paper title Journal or Conference Year Pages
and also if Author is tony then the text tony should be in bold.
|
|
|
|
|
Check out the XSLT tutorial on www.w3schools.com. If I remember well the example they provide does just this.
|
|
|
|
|
Hi guys i have one query,
I created textboxes dynamamicaly. when i select 2 in dropdown list two text boxes will come same i will select 100 or more. that i created, now i want to how to validate those text boxes? i done server side vaditation but i want to client side validation. so please help me.....
Thanks advance
praveen kumar....................
Praveen Kumar.R
|
|
|
|
|
I think you need to post this in the ASP.NET forum. Anyway, why don't you create validation controls dynamically too. On the server side you can access the dynamic textboxes client IDs and set up your validation controls accordingly to your needs.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Hi guys
Can anyone tell me where I could obtain a copy of XMLClassGenerator.exe?
I have tried the net but no luck.
Regards
Carmelo
|
|
|
|
|
Try searching with "XML Code Generator".
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Thank you for that George I have already tried but it does not come up with the one I want.
I am hoping someone might have it amongst there collection of utilities.
Regards
Carmelo
|
|
|
|
|
say i have a node pointer
::IXMLDOMNodePtr node;
this node shd be like:
<nodename visible="true">datahere
how do i set the string datahere, what do you call this one? thanks!
nathan
|
|
|
|
|
Hi I am displaying using XSL in table,
where some of column values i will be it in xml dynamically. I have given
the border size as 1 and color as black. some times i am getting the values as empty or null the the same will be updated in XML, but during display those nulled or emptied values are not displaying with borders. web borwser control completing eleminating the cell border. Is ther anyway to do it?
Thanks
srini
|
|
|
|
|
Try to replace null with
Regards,
Arun Kumar.A
|
|
|
|
|
I lost a few hours to this problem this morning, and after I discovered the workaround I felt like ranting, but now I've cooled down a bit (and had a beer).
Anyway... I have an XML file with embedded stylesheets (XSL). One of these stylesheets transforms the XML to CSV. An important part of this transform is the insertion of linefeeds, I do this with <xsl:text> </xsl:text> , and it worked fine until I started using an XmlReader to perform a validated read.
This works; the resultant XmlElement's text is a linefeed.
System.Xml.XmlDocument doc = new System.Xml.XmlDocument() ;
doc.Load ( @"\XMLtest.xml" ) ;
This doesn't work; the resultant XmlElement's text is empty.
System.Xml.XmlDocument doc = new System.Xml.XmlDocument() ;
System.Xml.XmlReaderSettings rs = new System.Xml.XmlReaderSettings() ;
(set the XmlReaderSetting's properties.)
doc.Load ( System.Xml.XmlReader.Create ( @"\XMLtest.xml" , rs ) ) ;
So then, looking through the help for XmlReader I see:
XmlReader objects created by the Create method expand all entities automatically.
So I assume that the entity gets expanded, then the linefeed (whitespace) is determined to be non-essential and removed, leaving an empty value.
Looking further I see:
If you must expand entities on request (readers created by the Create method expand all entities), or if you do not want your text content normalized, use the XmlTextReader class.
Now wait a minute! Isn't the XmlTextReader, not recommended practice?
In the Microsoft .NET Framework version 2.0 release, the recommended practice is to create XmlReader instances using the System.Xml.XmlReader.Create method.
XmlReader objects created by the Create method are, by default, more conformant than the XmlTextReader implementation.
So the workaround I chose is:
System.Xml.XmlDocument doc = new System.Xml.XmlDocument() ;
System.Xml.XmlReaderSettings rs = new System.Xml.XmlReaderSettings() ;
(set the XmlReaderSetting's properties.)
doc.Load ( System.Xml.XmlReader.Create ( new System.Xml.XmlTextReader ( @"\XMLtest.xml" ) , rs ) ) ;
It gets the job done, but it seems odd that there isn't a property in the XmlReaderSettings to do this. I tried the IgnoreWhitespace and CheckCharacters properties but to no avail.
My question is: Does .net 3.0 solve this issue? Does anyone else have cleaner workaround?
|
|
|
|
|
I think you may need to use the xml:space attribute in you XML document. It has two values, "default" and "preserve". "default" value tells the XML processor to handle space as necessary. Also, this is the default behavior of the processor. "preserve" means to maintain whitespace as is. Also, is not an entity, and > is an entity.
Example:
<poem xml:space="preserve">
... all whitespace will be preserved in all child nodes(remember text is considered a node) ...
<poem/>
Unfortunately, I found the following: http://www.stylusstudio.com/xmldev/200307/post70060.html#[^]
-- modified at 20:16 Friday 1st June, 2007
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
I'll give that a try, thanks.
|
|
|
|
|
George L. Jackson wrote: Also, is not an entity, and > is an entity.
It's character reference[^]! Awesome, I didn't know there is difference between them till now.
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
"Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
hi,
How can i create XSD from XML document programmatically in C#?
Also is there a tool available to achieve this?
|
|
|
|
|
If you have Visual Studio 2005, you just open up an XML file and there will be a XML Menu with a menu item, "Create Schema". Also, a toolbar button to create a schema may also appear. I believe this works in Standard and above. However, I am not sure about Express.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
AmitG77 wrote:
Also is there a tool available to achieve this?
XML Schema Definition Tool (Xsd.exe)[^]
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
"Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
I am trying to create an Excel file with the XMLTextWriter class. I am successfully able to write the excel file with data from dataset in it. But the problem is that the string data being written in Excel is not visible fully in the cells.
I tried the option of AutoFitWidth="1", But it does not comes into effect for String data. I also got some clue for using System.Drawing.Graphics.MeasureString method. But I am not able to use it in Web project.
Can anyone guide me as to how can I fit the width of the string text in excel cell programatically.
If my mind can conceive it, and my heart can believe it, I know I can achieve it.
|
|
|
|
|
I don't know much about spreadsheetML, but if I recall autofit is a property of the column and not the cell. Are you setting it as a column property?
Sorry, but if that doesn't fix the problem I really don't know what will. I don't normally jump into a topic I don't know that well, but since no one else has answered I thought I'd throw my hat in.
|
|
|
|