|
Hi all,
We have an xsl file from which we are reading content and displaying it in a .aspx page.
We want to include a footer at the end of every page in the print preview.
We are facing a lot of problems in the positioning of the footer.
Is there any way to ensure that the footer comes at the end of the page irrespective of the page content ala footer in word?
Thanks in anticipation.
If you fail for the first time , call it version 1.0.
|
|
|
|
|
Hi,
I am trying to use XML file as an config file. The structure of the xml file is quite simple. It needs to have only
5 fields. This file stores information about 3 websites - so ideally structure should be like
<root>
<config>
<website 1="">
<url>test
<delay>23
<username>23
<password>32423
<website 2="">
<url>test
<delay>23
<username>23
<password>32423
I am using following code to create this Xml schema and xml file - but having some trouble (which i don't know WHY -
and I seek your guidence...)
public void create_Config_Table(string service_name, string url, string delay,
string freq, string username, string password)
{
string filename = "config.xml";
FileStream fs;
XmlTextWriter xtw;
XmlTextReader xtr;
string msg = "";
//create the table and then populate it
DataTable ret = new DataTable(service_name);
//Create the DataSet
DataSet ds = new DataSet("AutoMessage");
//first check if config.xml exists or not
//If it already exists then we don't have to recreate the XML schema for it
if( ! File.Exists(filename) )
{
//ret.Columns.Add("Service", Type.GetType("System.String"));
ret.Columns.Add("URL",Type.GetType("System.String"));
ret.Columns.Add("Delay", Type.GetType("System.String"));
ret.Columns.Add("Frequency",Type.GetType("System.String"));
ret.Columns.Add("Username",Type.GetType("System.String"));
ret.Columns.Add("Password",Type.GetType("System.String"));
//Now populate the data table
DataRow row = ret.NewRow();
//row["Service"] = service_name;
row["URL"] = url;
row["Delay"] = delay;
row["Frequency"] = freq;
row["Username"] = username;
row["Password"] = password;
ret.Rows.Add(row);
ds.Tables.Add(ret);
msg = "Config File Created";
}
else
{
//Read the XML File
try
{
fs = new FileStream(filename, FileMode.Open);
xtr = new XmlTextReader(fs);
ds.ReadXml(xtr);
xtr.Close();
DataTable dt = ds.Tables[0];
DataRow row = dt.NewRow();
//row["Service"] = service_name;
row["URL"] = url;
row["Delay"] = delay;
row["Frequency"] = freq;
row["Username"] = username;
row["Password"] = password;
dt.Rows.Add(row);
ds.Tables.Remove(ds.Tables[0].TableName);
ds.Tables.Add(dt);
msg = "Config File Updated";
}
catch(Exception ex) { Console.Error.WriteLine(ex.ToString() ) ; }
fs = null;
}
try
{
fs= new FileStream(filename, FileMode.Append,FileAccess.Write);
xtw = new XmlTextWriter(fs, System.Text.Encoding.Unicode);
ds.WriteXml(xtw);
xtw.Close();
Console.Write(msg);
}
catch(Exception ex) { Console.Error.WriteLine(ex.ToString() ); }
}
Logic here is that if file doesn't exists - it will create the xml schema and the xml file
if it does EXISTS - then it is read into an dataset - new values are appeneded to contents of this dataset it is
written back as a xml file.
- Major problem is that it creates a mal-formed XML (multiple root elements)
-- Any Suggestions
THanx in advance
|
|
|
|
|
System.IO.StringReader sr = new System.IO.StringReader(ds.GetXml());
System.Xml.XmlTextReader xtr = new System.Xml.XmlTextReader(sr);
ds.WriteXml("cpTest.xml");
Creates a file which looks like the following;
<AutoMessage>
<Services>
<URL>test.com</URL>
<Delay>5</Delay>
<Frequency>10</Frequency>
<Username>mnvkng76</Username>
<Password>aPassword</Password>
</Services>
</AutoMessage>
Is that what you needed?
|
|
|
|
|
This is what I want:
ns0:Interchange xmlns:ns0="http://www.e2b.no/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.e2b.no/XMLSchema e2b_Invoice_Interchange_v3p2.xsd"
The attribute schemaLocation I make with this code
<br />
XmlAttribute atrXsiSchemaLocation = null;<br />
atrXsiSchemaLocation = invoiceE2BDocument.CreateAttribute("xsi:schemaLocation");<br />
atrXsiSchemaLocation.Value = "http://www.e2b.no/XMLSchema e2b_Invoice_Interchange_v3p2.xsd";<br />
elmInterchange.Attributes.Append(atrXsiSchemaLocation);<br />
But the "xsi:" is somehow gone and I get
schemaLocation="http://www.e2b.no/XMLSchema e2b_Invoice_Interchange_v3p2.xsd"
So I replaced the code with:
<br />
atrXsiSchemaLocation = invoiceE2BDocument.CreateAttribute("xsi", "schemaLocation", "xsi");<br />
but then I got:
d3p1:schemaLocation="http://www.e2b.no/XMLSchema e2b_Invoice_Interchange_v3p2.xsd" xmlns:d3p1="xsi"
Does anyone know how to fix this?
Thanks
Thomas
-- modified at 8:35 Friday 13th October, 2006
|
|
|
|
|
Does the following work?
atrXsiSchemaLocation = invoiceE2BDocument.CreateAttribute("xsi", "schemaLocation", "http://www.w3.org/2001/XMLSchema-instance");
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
No the result was:
d3p1:schemaLocation="" xmlns:d3p1="http://www.e2b.no/XMLSchema e2b_Invoice_Interchange_v3p2.xsd"
|
|
|
|
|
Just before I save the xml file:
<br />
invoiceE2BDocument.InnerXml = invoiceE2BDocument.InnerXml.Replace("schemaLocation", "xsi:schemaLocation");<br />
It's not a good solution, but it works.
|
|
|
|
|
You should either check the "Ignore HTML tags in this message" box situated beneath the smilies or replace all opening tags with <, so we are able to see your xml.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi,
I need to generate documentation in the chm(compiled html) format.
what i did is I generated xml file from visual studio,now can you tell me any converter for XML to Chm.
Thanks
Today is a gift, that's why it is called the present.
|
|
|
|
|
There is the open-source project NDOC but it's no longer active AFAIK and doesn't support .NET 2.0.
Microsoft has also released a help builder called Sandcastle they used to build framework documentation. Take a look at this article[^] which presents a nice GUI for it.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
hi
how can i convert the content specified in the parameters text box(parameter indicates that textbox can consist any parameter that is used to make query) to filter encoded xml.
thanx in advance.
|
|
|
|
|
xn.OuterXml
"<doclibs text="\"Corporate" services\"="" url="\"http://sanpaula/CorporateServices\"" id="\"996bba7e-3d2a-406a-a0e5-90f39589ed9f\""><doclibs text="\"Secretary's" office\"="" url="\"http://sanpaula/C4/SecretaryOffice\"" id="\"23baa62f-5dd3-461a-875e-f37fa0035d71\""><doclib text="\"Dummy\"" id="\"-1\"">"
Corporate Services
Secretary's Office
xn.SelectSingleNode("*[@text='Secretary's Office']");
This is probably a stupid question. My xml contains a single quote in Secretary's Office. When searching, I tried replacing ' with ' but this did not work.
Is the answer simply that the XML is incorrect?
|
|
|
|
|
C# does not understand entities! Use escape sequences.
xn.SelectSingleNode("*[@text=\"Secretary\'s Office\"]");
|
|
|
|
|
Thanks, that did the trick. However you'd be up the creek if text contained both " and '
If the XML police saw the xml which contained ',",&,<,> wouldn't they give me a ticket?
|
|
|
|
|
Hello,
I need to create a XML to XML conversion with XSLT.
Could someone help me out with this?
My original XML is:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns = "http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode>
<siteMapNode
url = "~/Page01.aspx"
name = "Page01"
visible = "true" />
<siteMapNode
url = "~/Page02.aspx"
name = "Page02"
visible = "false" />
</siteMapNode>
</siteMap>
Would become:
<?xml version="1.0" encoding="UTF-8"?>
< urlset xmlns="http://www.google.com/schemas/sitemap/0.84">
< url>
< loc>http://www.mydomain.com/Page01.aspx</loc>
< title>Page01</title>
</url>
</urlset>
So the following actions take place:
1. siteMap xmlns = "http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" becomes urlset xmlns="http://www.google.com/schemas/sitemap/0.84"
Node siteMap becomes node urlset.
2. The node "siteMapNode" becomes the node "url"
3. Only the nodes where attribute "visible" is "true" are copied to the new XML file.
4. Property visible is not copied to the new file.
5. Property "url" becomes node "loc" and "~" is replaced by "http://www.mydomain.com"
6. Property name becomes node title.
Well, I think I didn't forget anything.
Thank You Very Much
Miguel
|
|
|
|
|
I hope you got the idea but still what you are expecting from the people.. can you make it clear?
Sathik
|
|
|
|
|
The easiest way to transform XML to another hierarchy is to use a combination of xsl:copy and xsl:copy-of.
|
|
|
|
|
Hi all
I am having a problem in my xslt and xml
this is my xml file:
<a1>
<property owner="Wallace Chan1" id="p002" type="condominium">
<owner>Some company1</owner>
<address>
<streetno>35</streetno>
<streetname>Kingsbridge Garden Circlen</streetname>
<city>Mississauga</city>
<zipcode>L5r3z5</zipcode>
<state>Ontario</state>
<country>Canada</country>
</address>
</property></a1>
and here is my xsl file:
<xsl:template match="/">
<html>
<head><title>CSCC09 assignment 1, phase 1</title></head>
<body> <h2>List of properties:</h2>
<xsl:for-each select="a1/property[@type='condominium']">
<xsl:apply-templates/>
</xsl:for-each>
</table>
<br/>
<h3>House</h3>
<table>
</body></html>
</xsl:template>
<xsl:template match="property">
<tr>
<xsl:apply-templates/>
</tr>
</xsl:template>
<xsl:template match="owner">
<td>
<xsl:value-of select="text()"/>
</td>
</xsl:template>
</xsl:template>
</xsl:stylesheet>
I want to display the owner infomation in a table for each property. This xsl is working well, however it is showing all the other infomation in address as well...
its showing up all the PCDATA in <address>, with all spaces removed, and then showing up all the owner infomation correctly in the table.
how can i removed all the unwanted PCDATA?
thx thx
|
|
|
|
|
<xsl:apply-templates/> needed to be written to filter out the unwanted data:
<xsl:template match="/">
<html>
<head>
<title>CSCC09 assignment 1, phase 1</title>
</head>
<body>
<h2>List of properties:</h2>
<table>
<xsl:apply-templates select="a1/property[@type='condominium']"/>
</table>
<br/>
<h3>House</h3>
</body>
</html>
</xsl:template>
<xsl:template match="property">
<tr>
<xsl:apply-templates select="owner"/>
</tr>
</xsl:template>
<xsl:template match="owner">
<td>
<xsl:value-of select="."/>
</td>
</xsl:template>
|
|
|
|
|
how can i enable debugging in web service?
my client cannot access the service if i create it in the wwwroot\folder\service... however it can access it wwwroot\service like this can i get a logical reason for this
bu
|
|
|
|
|
I have an XML server control places in an aspx-page. The document-source is ="inhoud.xml" and the transformSource="inhoud.xslt. When I run it, it returns "'xsl' is an undeclared namespace".
What am I missing here? What do I do wrong?
A xls-newbie...
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="xsltest.aspx.vb" Inherits="StyleSheetTest.xsltest"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>xsltest</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<asp:Xml id="Xml1" runat="server" DocumentSource="inhoud.xml" TransformSource="inhoud.xslt"></asp:Xml>
</form>
</body>
</HTML>
content of inhoud.xlst:
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/website">
<xsl:apply-templates select="website">
<xsl:apply-templates select="pagina">
<p><xsl:value-of select="pid"/></p>
<p><xsl:value-of select="rangnr"/></p>
<p><xsl:value-of select="titel"/></p>
<p><xsl:value-of select="inhoud"/></p>
</xsl:apply-templates>
</xsl:apply-templates>
</xsl:template>
</xsl:stylesheet>
Content of inhoud.xml:
<?xml version="1.0" encoding="utf-8" ?>
<website>
<pagina>
<pid></pid>
<rangnr></rangnr>
<titel></titel>
<inhoud></inhoud>
</pagina>
</website>
|
|
|
|
|
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
led mike
|
|
|
|
|
Sometimes I am so blind.... thanks Mike
|
|
|
|
|
Hi,
I have some webservice running on windows 2003 machine over SSL (Does not require client certificate. SSL, just to encrypt the data).
I made a client in VB6 which uses Soap Toolkit 3 to access the webservice.
Everything works fine if I use the client on windows2003 or windows XP machine. Client can deal with the webserice using "https" URL.
But, when I tired running the client over win2000 machine, it gave me following error.
---
Connector:Unspecified HTTP error. HRESULT=0x800A1518 - Client:An unanticipated error occurred during the processing of this request. HRESULT=0x800A1518 - Client:Sending the Soap message failed or no recognizable response was received HRESULT=0x800A1518 - Client:Unspecified client error. HRESULT=0x800A1518
----
Then I changed the code so that it references the webserice with "http". It worked.
Then what I figured out is..
On win2000 machine when I wrote the url with "https" in browser, I got security warning "u r about to see secure item". This warning was not seen when I wrote the URL in win2003 and XP. So, I think the Soap Toolkit can not deal with that security warning?
Can anybody tell me how to solve this?
Any help will be appreciated.
- PPT
|
|
|
|
|
Looks like you have a space just after the "<" of the "employee_db" element. XML does not support spaces there.
|
|
|
|