|
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
|
|
|
|
|
I'am guessing you don't wanna use WPF. Use the classes in the System.xml namespace to parse the xml, and then dynamicly create and add controls to the form, setting the position, size, color, text and so on according to the data in the xml. (I am asuming you are using C#/.net). If you use c++/MFC you can do it with parsing the xml with a library like TinyXML and then create the controls dynamicly based on the data in the xml.
|
|
|
|
|
Hi,
yes I am using .Net/C#
I need something like this.
Suppose I have Xml like
<root>
;
Now When I render "Windows Form" it has lable like in given xml.
Thank you,
Devaang
|
|
|
|
|
well, lets asume you have created a class that contain the data parsed from the xml (lets call it LabelData) and that you have a list with objects of that type containing the data for all the lables you wants to add to the form (lets call the list LabelDataList). the code will look something like this.
public class LabelData
{
public string Name;
public string Text;
public int x,y;
public int width,height;
....
};
List<LabelData> LabelDataList;
LabelDataList=new List<LabelData>();
....
....
if (Node.NodeType == XmlNodeType.Element)
{
if (Node.Name == "Label")
{
XmlElement NodeElement = Node as XmlElement;
LabelData tmpLD=new LabelData();
LabelDataList.add(tmpLD);
}
}
....
....
foreach(LabelData ld in LabelDataList)
{
Label newLabel=new Label();
newLabel.Name=ld.Name;
newLabel.Text=ld.Text;
newLabel.Location=new Point(ld.x, ld.y);
newLabel.Size=new Size(ld.width, ld.height);
....
....
this.Controls.Add(newLabel);
}
ofcourse you can create the labels and add them to the form directly in the loop you use to parse the xml too, when it comes to parsing the XML there is many ways to do it, maybe the easiest one is to load the data into a DataTable and loop through the rows in the DataTable.
modified on Tuesday, August 11, 2009 4:11 AM
|
|
|
|
|
Hi Annathor
Thanks for your interest...
As I have to generate class from xml right for it Fist I have to create schema from xml and then have to generate class from it.
Can I use xml directly??
And second question is :
I want to bind control from xml file.
means suppose my xml like
<editcontrol datamember="address" editable.binding="={@registered_responsible_party}" type="TextBox" location="100,76" size="240,20" label.text="Address" label.location="10,76" label.size="90,20">
So it means "address" columns of database will be bind to textbox
|
|
|
|
|
English isn't my first language, so I don't understand your question.
Do you want to store the column name in a text box? if so you could make a control that inherit from the textbox class like this:
public class ExtendedTextbox:Textbox
{
public string ColumnName;
}
and use the ExtendedTextbox insted of the normal Textbox class.
and save the column name in the ColumnName varible like this:
ExtendedTextbox etb=new ExtendedTextbox ();
etb.Name="Something";
etb.ColumnName="Something";
...
...
this.Controls.add(etb);
|
|
|
|
|
Hi - Any help or guidance would be appreciated. I am trying a new xml file with the total of one of the specific elements - below is the original xml file:
<Report>
<Unit>
<Name>t1</Name>
<Price>32</Price>
<Other>sdasd</Other>
</Unit>
<Unit>
<Name>t1</Name>
<Price>42</Price>
<Other>dasdasd</Other>
</Unit>
<Unit>
<Name>t2</Name>
<Price>11</Price>
<Other>asdas</Other>
</Unit>
<Unit>
<Name>t3</Name>
<Price>21</Price>
<Other>dasd</Other>
</Unit>
<Unit>
<Name>t1</Name>
<Price>65</Price>
<Other>dasda</Other>
</Unit>
The xsl that I am trying to us is as follows: instead of giving me 1 value it gives me a list of all t1 values rather than a sumation
<test>
<xsl:if test="Name = 't1'">
<xsl:variable name="value1" select ="sum(Price)"/>
<xsl:value-of select="$value1"/>
</xsl:if>
</test>
thanks
|
|
|
|
|
This XSL stylesheet will output a single 'test' tag containing the total you want. Note that I construct a list of all the 'Price' tags (with //Price ) and filter that list with a predicate on the sibling Name tag ([../Name='t1'] ).
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<test>
<xsl:value-of select="sum(//Price[../Name='t1'])"/>
</test>
</xsl:template>
</xsl:stylesheet>
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|