|
what cant you get? a little more information please.
And i think this should ba a screenshot?
cheers
|
|
|
|
|
Icarus123 wrote: but i cannot get the <title> value.
w3schools.com wrote: Everything inside a CDATA section is ignored by the parser.
CDATA[^]
|
|
|
|
|
For a simple example, I have an access database which has 2 columns:
Let's say one column is InputXML and other column is OutputXML that we want.
This contains the mapping rules.
The table structure is as follows:
INPUTXML OUTPUTXML
Fname First Name
Lname Last Name
So basically Fname in input XML should be changed to First Name in output XML. So the database just has the mapping rules for the transformation and not the values.
Now the task is to create a dot net windows application that has a button called GENERATE XSLT . On clicking this button, it should dynamically generate the XSLT taking the mapping rules from the database. In other words instead of hardcoding the XSLT , based on the DB mapping rules like Fname to FirstName etc, it should just generate the code for XSLT in a txt file or XSL file, which is the code which does the transformation.
So basically an XSLT code generator should be written.
Someone said there is a function call or API in dot net which generates the xslt template, I just have to define the relationships among them using values from DB. Not even sure what this means.
Any help on how to approach solving this problem or some starting idea (some psuedo code or anything ) would be great, I am learning Dot net as well as XML/XSLT.
If you are aware of the API also, please let me know as it will save me some searching time. Hope someone helps.
Thanks,
Sdee
sdee
|
|
|
|
|
sdee2 wrote: Someone said there is a function call or API in dot net which generates the xslt template
System.Xml.Xsl.XslTransform is the XSLT processor but I am not aware of any library that generates XSLT. However XSLT "is" XML so you can use any of the XML mechanisms to create XSLT.
|
|
|
|
|
Hello, it's me again :p
I'm searching on the web for over two hours now, but I have not found what I am looking for.
So... can anyone provide me a link to a list of all possible xml character sets?
charset example:
<?xml version="1.0" encoding="gb2312" ?>
-> gb2312 == Chinese
Thank You!!
~uumppa
|
|
|
|
|
|
hello,
Ive come across a highlight function that i was able to add to a search feature i have on a page. however the current method it uses will wrap text that is found even inside of html so its making the tags no longer work. has anyone dealt with this type of thing before?
here's the highlighter template
example of problem
$text = <a href="http://www.walkthroughs.com">Simple steps to walkthrough</a>
$what = walk
output=<a href="http://www.<font style...>walk</font>throughs.com">Simple steps to <font style...>walk</font>through</a>
<code> <xsl:template name="highlighter">
<xsl:param name="text"/>
<xsl:param name="what"/>
<xsl:variable name="test-text">
<xsl:call-template name="lower">
<xsl:with-param name="tolower" select="$text" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name="test-what">
<xsl:call-template name="lower">
<xsl:with-param name="tolower" select="$what" />
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="contains($test-text, $test-what)">
<xsl:variable name="before" select="substring-before($test-text,$test-what)"/>
<xsl:variable name="after" select="substring-after($test-text,$test-what)"/>
<xsl:variable name="real-before" select="substring($text, 1,string-length($before))"/>
<xsl:variable name="real-after" select="substring($text,string-length($before) + string-length($what) + 1)"/>
<xsl:value-of select="$real-before" disable-output-escaping="yes"/>
<font style="background-color:#66FF66"><xsl:value-of select="$what" disable-output-escaping="yes"/></font>
<xsl:call-template name="highlighter">
<xsl:with-param name="text" select="$real-after"/>
<xsl:with-param name="what" select="$what"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$text" disable-output-escaping="yes"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template></code>
Id appreciate any insight on this. i thought that perhaps i could examine for an unclosed < in before variable and unopened > in after but im not sure what the best way to do this would be
Thanks in advance
werD, MCP
|
|
|
|
|
this is what im thinking.
the higlighter template uses before term and after
so
$text = <a href="http://www.walkthroughs.com">Simple steps to walkthrough</a>
$what = walk
before1 = <a href="http://www.
term1 = walk
after1 =throughs.com">Simple steps to walkthrough</a>
im thinking that i can use a reverse function and have
before1rev = .www//:ptth"=ferh a<
after1rev = >a/<hguorhtklaw ot spets elpmiS>"moc.shguorht
i was thinking i could run some logic off of that to get an intended result but now im just dizzy :S
any thoughts?
CODE
<xsl:template name="nonhtmlreplace">
<xsl:param name="before" />
<xsl:param name="before-reversed"/>
<xsl:param name="after" />
<xsl:param name="after-reversed" />
<xsl:param name="what" />
<xsl:choose>
<xsl:when test="contains($before-reversed,'<') and not(contains($before-reversed,'>'))">
/\<xsl:value-of select="$before" disable-output-escaping="yes"/><xsl:value-of select="$what" disable-output-escaping="yes"/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="string-length(substring-before($before-reversed,'<')) < string-length(substring-before($before-reversed,'>'))">
<xsl:value-of select="$before" disable-output-escaping="yes"/>
<font style="background-color:#66FF66">
<xsl:value-of select="$what" disable-output-escaping="yes"/>
</font>
</xsl:when>
<xsl:otherwise>
-<xsl:value-of select="$before" disable-output-escaping="yes"/>
<xsl:value-of select="$what" disable-output-escaping="yes"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
here's the reverse function im using
CODE
<xsl:template name="reverse">
<xsl:param name="theString"/>
<xsl:variable name="thisLength" select="string-length($theString)"/>
<xsl:choose>
<xsl:when test="$thisLength = 1">
<xsl:value-of select="$theString"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="restReverse">
<xsl:call-template name="reverse">
<xsl:with-param name="theString"
select="substring($theString, 1, $thisLength -1)"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of
select="concat(substring($theString,
$thisLength,
1
)
,$restReverse
)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
|
|
|
|
|
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?
|
|
|
|