|
Hi All,
We have a C# windows application which will transform the xml and xslt we give into a .aspx page. The user has to specify the XML and the .aspx file name , we have a standard XSLT which will use the xml and create the file with the name specified by the user. The problem we face is in the .aspx page we want to write the Page attribute E.g. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" >; where we include the .aspx.cs file name , but this value comes from the C# code , how can we import the textbox value from C# code into our standard XSLT to write the page attribute in our to be generated .aspx page. Please Advice.TIA
Regards,
Nancy
|
|
|
|
|
Add a parameter at the top level of the XSLT file:
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="xsl">
<!-- Allow the user to specify the .cs filename -->
<xsl:param name="CSFilename"/>
<!-- The rest of your XSLT - use $CSFilename to access the .cs filename -->
</xsl:stylesheet>
You then use the XsltArgumentList[^] class to add the parameter values when you perform the transform.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
If you can add an XSD schema to a .docx and add the elements to the doc itself, then how do you send data to this? Can you use word automation via VB.Net 2008?
|
|
|
|
|
Hi All,
We have two .xml files, one has the details about categories and in the other .xml file we need to reference the categories. When we searched in net we found that we need to declare the categories as entities in the DTD file and use them in the xml, but we want to take the categories from the xml file only. Kindly advice. TIA
Regards,
Nancy
|
|
|
|
|
You could use XInclude to logically include the 'categories' XML file in the file that needs to reference the categories?
A question - when do the category usages need to be resolved to the original categories? What processing step *NEEDS* the link between category use and category definition to be available?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks for your help.
In brief we have an xml file (kind of Master XML) which has all categories and Values for Each category Eg. Technology, Department will be categories, Technology will hold values like Technology_id and Technology_name, same for department.
We have another XML(Pagewise) which describes about what controls should be in each page. E.g. Listbox, Button , Radio button. The XSLT file will use the Pagewise XML to get details about the controls and the master xml to get the details about the values to be stored in controls like Listbox.
We are actually trying to create dynamic .aspx pages using XML and XSLT.
Regards,
Nancy
|
|
|
|
|
If you're using xslt, then there's always the document function[^] that allows you to read in a separate XML document.
Alternatively, the XInclude[^] suggestion will work with XSLT, provided your XSLT processor has support.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks a lot for your help
Regards,
Nancy
|
|
|
|
|
Hi dear friends,
from last few days i am digging my head like anything for loading rss feed(its nothing but a xml file) in to mozilla browser.
i am succesfully load that and displayed in IE but unable to load it in mozzlia.here the link for rss feed is-"http://www.ed.gov/rss/edgov.xml".
here i am able to dtect the browser but unable to load it in mozilla
plz help me out.
<br />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br />
<html xmlns="http://www.w3.org/1999/xhtml" ><br />
<head><br />
<title>Untitled Page</title><br />
<script type="text/javascript"><br />
if(navigator.appName == "Netscape")<br />
{<br />
alert("You're using a Netscape browser.")<br />
function loadXML()<br />
{<br />
<br />
var xmlDoc = document.implementation.createDocument("", "", null) <br />
xmlDoc.load("http://www.ed.gov/rss/edgov.xml");<br />
xmlDoc.onload = readXML;<br />
<br />
alert("hi")<br />
document.getElementById("title").innerHTML= xmlDoc.getElementsByTagName("title")[2].firstChild.nodeValue<br />
document.getElementById("description").innerHTML= xmlDoc.getElementsByTagName("description")[2].firstChild.nodeValue<br />
<br />
document.getElementById("title1").innerHTML= xmlDoc.getElementsByTagName("title")[3].firstChild.nodeValue<br />
document.getElementById("description1").innerHTML= xmlDoc.getElementsByTagName("description")[3].firstChild.nodeValue<br />
<br />
document.getElementById("title2").innerHTML= xmlDoc.getElementsByTagName("title")[4].firstChild.nodeValue<br />
document.getElementById("description2").innerHTML= xmlDoc.getElementsByTagName("description")[4].firstChild.nodeValue<br />
<br />
document.getElementById("title3").innerHTML= xmlDoc.getElementsByTagName("title")[4].firstChild.nodeValue<br />
document.getElementById("description3").innerHTML= xmlDoc.getElementsByTagName("description")[4].firstChild.nodeValue<br />
<br />
document.getElementById("title4").innerHTML= xmlDoc.getElementsByTagName("title")[5].firstChild.nodeValue<br />
document.getElementById("description4").innerHTML= xmlDoc.getElementsByTagName("description")[5].firstChild.nodeValue<br />
<br />
document.getElementById("title5").innerHTML= xmlDoc.getElementsByTagName("title")[6].firstChild.nodeValue<br />
document.getElementById("description5").innerHTML= xmlDoc.getElementsByTagName("description")[6].firstChild.nodeValue<br />
<br />
<br />
}<br />
<br />
<br />
<br />
<br />
}<br />
if(navigator.appName == "Microsoft Internet Explorer")<br />
{<br />
var xmlDoc<br />
function loadXML()<br />
{<br />
if (window.ActiveXObject)<br />
{<br />
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");<br />
xmlDoc.async=false;<br />
xmlDoc.load("http://www.ed.gov/rss/edgov.xml");<br />
xmlObj=xmlDoc.documentElement; <br />
<br />
if (xmlDoc.readyState != 4) <br />
{ <br />
return false; <br />
} <br />
<br />
document.getElementById("title").innerHTML= xmlDoc.getElementsByTagName("title")[2].firstChild.nodeValue<br />
document.getElementById("description").innerHTML= xmlDoc.getElementsByTagName("description")[2].firstChild.nodeValue<br />
<br />
document.getElementById("title1").innerHTML= xmlDoc.getElementsByTagName("title")[3].firstChild.nodeValue<br />
document.getElementById("description1").innerHTML= xmlDoc.getElementsByTagName("description")[3].firstChild.nodeValue<br />
<br />
document.getElementById("title2").innerHTML= xmlDoc.getElementsByTagName("title")[4].firstChild.nodeValue<br />
document.getElementById("description2").innerHTML= xmlDoc.getElementsByTagName("description")[4].firstChild.nodeValue<br />
<br />
document.getElementById("title3").innerHTML= xmlDoc.getElementsByTagName("title")[4].firstChild.nodeValue<br />
document.getElementById("description3").innerHTML= xmlDoc.getElementsByTagName("description")[4].firstChild.nodeValue<br />
<br />
document.getElementById("title4").innerHTML= xmlDoc.getElementsByTagName("title")[5].firstChild.nodeValue<br />
document.getElementById("description4").innerHTML= xmlDoc.getElementsByTagName("description")[5].firstChild.nodeValue<br />
<br />
document.getElementById("title5").innerHTML= xmlDoc.getElementsByTagName("title")[6].firstChild.nodeValue<br />
document.getElementById("description5").innerHTML= xmlDoc.getElementsByTagName("description")[6].firstChild.nodeValue<br />
<br />
}<br />
}<br />
<br />
<br />
}<br />
</script><br />
</head><br />
<body onload="loadXML()"><br />
<table width="100%" ><br />
<tr><br />
<td ><br />
<marquee onmouseover="if(this.stop)this.stop()" onmouseout="if(this.start)this.start()"><br />
<label id="title"> </label> - <label id="description"></label>;<br />
<label id="title1"></label> - <label id="description1"></label>; <br />
<label id="title2"></label> - <label id="description2"></label>; <br />
<label id="title3"></label> - <label id="description3"></label>;<br />
<label id="title4"></label> - <label id="description4"></label>;<br />
<label id="title5"></label> - <label id="description5"></label>;<br />
</marquee><br />
</td><br />
</tr><br />
</table><br />
</body><br />
</html><br />
<br />
|
|
|
|
|
Strange - I can load the URL (http://www.ed.gov/rss/edgov.xml) directly into FireFox, but using your code, I get this error in the Firebug console: Access to restricted URI denied" code: "1012
An aside - if you're using Firefox (and as you're using Mozilla, seems highly likely), use Firebug to help you debug your Javascript - it's an awesome tool!
In addition, I would also recommend using a Javascript library like jQuery or Prototype (I have experience of jQuery, but not Prototype) for cross-browser DOM manipulation like this - they allow you to a) write your code as if there was only one browser - the library will deal with the browser differences, and b) simplify your code significantly.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
HI,
Stuart Dootson.
Will you kindly give me ur code in which u have successfully loaded the xml file in to mozilla
|
|
|
|
|
No code - I typed the URL into the address bar...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
hai man.. i know dat link is working fine over mozilla browser.but my requirmnet is different.. i need to embeded the rss feeds inside that xml into html page dynamically.
|
|
|
|
|
Yes, I know. My first action was to save your code and run it - at which point I got the error message I described. So, I tried the URL via the address bar and it worked.
I've since found this page[^], which describes the error message, but in relation to jQuery. It tells you that FireFox's security model is stopping you access the page.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi All,
Please tell me how to do the following:
XML save and load of data to SQL Server 2005 database?
Thanking you in advance,
Regards,
Ashwath Hegde.
|
|
|
|
|
Hello,
I have written a XSL which is to read the data from a DTO and write to a .CSV file with the following format. I am not able to create semi-colon values and also the padding format written is not being reflected in the output file. Can anyone help in incorporating these formats. I am attaching my XSL here for the reference. Thanks for the same.
-The file created is an excel file. The extension is “.CSV”.
-The data are separated by the character semi-colon “;”.
-Every data row end up with an end of row character and a carriage return character (CR/LF).
-The end of the file is marked by an empty record row. In other words, the last row only contain semi-colon characters and all the fields are empty.
If the data length is inferior to the data maximum size, a padding is done as following:
- the numeric data are filled with “0” (zero) on the left (for example 003)
- the alphanumeric data are filled with empty spaces “ “
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dft="http://MyProj.Dto.CustomerSpecificExport/">
<xsl:output method="text" indent="yes" />
<xsl:template match="/dft:ArrayOfExportDataDto">
<xsl:apply-templates select="dft:ExportDataDto"/>
</xsl:template>
<xsl:template match="dft:ExportDataDto">
- <xsl:call-template name="pad-right">
<xsl:with-param name="str" select="AgencyName" />
<xsl:with-param name="len" select="20" />
</xsl:call-template>
- <xsl:call-template name="pad-right">
<xsl:with-param name="str" select="CandidateName" />
<xsl:with-param name="len" select="20" />
</xsl:call-template>
- <xsl:call-template name="pad-right">
<xsl:with-param name="str" select="CandidateSurname" />
<xsl:with-param name="len" select="10" />
</xsl:call-template>
- <xsl:call-template name="pad-right">
<xsl:with-param name="str" select="BeginDate" />
<xsl:with-param name="len" select="10" />
<xsl:with-param name="pad" select="0" />
</xsl:call-template>
- <xsl:call-template name="pad-right">
<xsl:with-param name="str" select="InitialMissionEndDate" />
<xsl:with-param name="len" select="10" />
<xsl:with-param name="pad" select="0" />
</xsl:call-template>
- <xsl:call-template name="pad-left">
<xsl:with-param name="str" select="AmendmentDate" />
<xsl:with-param name="len" select="10" />
<xsl:with-param name="pad" select="0" />
</xsl:call-template>
- <xsl:call-template name="pad-left">
<xsl:with-param name="str" select="LastAmendmentDate" />
<xsl:with-param name="len" select="10" />
<xsl:with-param name="pad" select="0" />
</xsl:call-template>
- <xsl:call-template name="pad-left">
<xsl:with-param name="str" select="ResortCaseCode" />
<xsl:with-param name="len" select="3" />
<xsl:with-param name="pad" select="0" />
</xsl:call-template>
- <xsl:call-template name="pad-left">
<xsl:with-param name="str" select="MaxEndDateofContract" />
<xsl:with-param name="len" select="10" />
<xsl:with-param name="pad" select="0" />
</xsl:call-template>
- <xsl:call-template name="pad-left">
<xsl:with-param name="str" select="MinEndDateofContract" />
<xsl:with-param name="len" select="10" />
<xsl:with-param name="pad" select="0" />
</xsl:call-template>
- <xsl:call-template name="pad-right">
<xsl:with-param name="str" select="ModifVal" />
<xsl:with-param name="len" select="2" />
</xsl:call-template>
<xsl:text></xsl:text>
</xsl:template>
<xsl:template name="pad-left">
<xsl:param name="str"/>
<xsl:param name="len"/>
<xsl:param name="pad" select="' '"/>
<xsl:choose>
<xsl:when test="string-length($str) > $len">
<xsl:value-of select="substring($str, 1, $len)"/>
</xsl:when>
<xsl:when test="string-length($str) < $len">
<xsl:call-template name="pad-left">
<xsl:with-param name="str" select="concat($pad, $str)"/>
<xsl:with-param name="len" select="$len"/>
<xsl:with-param name="pad" select="$pad"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$str"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="pad-right">
<xsl:param name="str"/>
<xsl:param name="len"/>
<xsl:param name="pad" select="' '"/>
<xsl:choose>
<xsl:when test="string-length($str) > $len">
<xsl:value-of select="substring($str, 1, $len)"/>
</xsl:when>
<xsl:when test="string-length($str) < $len">
<xsl:call-template name="pad-right">
<xsl:with-param name="str" select="concat($str, $pad)"/>
<xsl:with-param name="len" select="$len"/>
<xsl:with-param name="pad" select="$pad"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$str"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:param name="separator" select="';'"/>
<xsl:param name="line-separator" select="' '"/>
</xsl:stylesheet>
|
|
|
|
|
RK11@2009 wrote: I am not able to create semi-colon values
I don't see you ever writing semi-colons or line separators to the output?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi All,
I need to generate dynamically .cs files in Dotnet 2.0 framework using XMl/XSLT. I went through many exmaples for .aspx page creation - one of the examples or links in this Forum is the below one
"http://www.codeproject.com/KB/XML/xmlxsltransformer.aspx". This exmaple was for .aspx page creation using XML/XSLT.
Like wise i need an example, code for .cs file creation through WINDOWS APPLICATION. TIA
Thanks,
Santa.
|
|
|
|
|
Hi,
I am not sure , Is this right section to place this question?
Where to find the specifications for the cross platform Data Format?
How do I submit my design?
Is it allowed to store the schema along with data in Same plain file?
Thanks,
Nagaraj
|
|
|
|
|
I think somethink like this:
<Data encryption="AES256">Some Encrypted Data</Data>
Is it safe to use it like this. And is there a chance that Encryption coud break xml format?
What other encrpytion coud i use?
And a if a user chose plain text, Are '< and '>' the only characters needed to parse?
|
|
|
|
|
Saksida Bojan wrote: Is it safe to use it like this. And is there a chance that Encryption coud break xml format?
Not safe - there is a good chance it could break.
Thing is - XML is a text format, and you're trying to embed an arbitrary byte stream in it. So, what you need to do is encode the encrypted byte stream as a character stream, using something like Base64[^] encoding. After that, you could mark the encoded text stream as CDATA[^] - wouldn't hurt...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
In Other words. I Shoud encrypt with aes256 and then encode in Base64?
Will Base64 UTF-7 encode conflict with Xml UTF-8 encode?
|
|
|
|
|
Saksida Bojan wrote: In Other words. I Shoud encrypt with aes256 and then encode in Base64?
Yes
Saksida Bojan wrote: Will Base64 UTF-7 encode conflict with Xml UTF-8 encode?
No - UTF7 is an example of a system that uses base64. You'll also be using base64 to encode binary using 64 characters - you won't be using UTF7.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
|
Hi All,
How can I control the layout of Windows forms using Xml file.
Thank you,
Devaang
|
|
|
|