473,320 Members | 1,920 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

XML declaration in middle of page?

I'm not sure if this would classify as an XML or ASP question:

I'm redoing someone's website who sells various products. I've decided to teach myself XSLT and re-do the entire site using XML.

I'm creating .aspx files with which will include an XML file of the products at the bottom of each page. To do this, I have the following code in my .aspx file where the XML data goes:

<asp:Xml runat="server" documentSource="more.xml" transformSource="awboi.xsl" id="Xml1" />

The XML file displays perfectly and is transformed exactly as it should be. However, when I go to validate the page at the W3C website, it will not validate because an XML declaration has been added at the point the code (above) is in my source.

So, in the middle of my source code is:

<?xml version="1.0" encoding="utf-8"?>
...and then all my transformed XML data


Is this a big deal not to pass validation on one error? Is there a way to prevent ASP from adding the XML declaration in the middle of my page? I'm using Expression Web if that makes any difference.

Thanks for any thoughts. I appreciate it. This is only my 3rd day of learning XML and XSLT, so go easy on me.

Here are the links to the various pages:

Page in question: Sample Page - View Source to see what I mean
XML source: XML File
XSL source: XSL File
Dec 29 '08 #1
3 2361
Frinavale
9,735 Expert Mod 8TB
Please post the code you have that applies the XSL to the XML.
You may have to remove the "<?xml version="1.0" encoding="utf-8"?>"' after the XML has been transformed (something like this).

-Frinny
Dec 30 '08 #2
Dormilich
8,658 Expert Mod 8TB
you could try the following:
Expand|Select|Wrap|Line Numbers
  1. <xsl:output 
  2.     method="xml"
  3.     omit-xml-declaration="yes" />
Dec 30 '08 #3
Thanks Dormilich! You're awesome! That worked perfectly.
Dec 30 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Tim Streater | last post by:
I want to generate a web page using PHP, and in the middle generate a graphic I read from another server. So the graphic is in $picture. So I can either write $picture to a temp file and then use...
3
by: DS | last post by:
I would like to construct a frame in the middle of a page, similar to a text box with scrollers, but I want the part in the box to be AN html page .... What I want to do is take a LARGE amount...
7
by: seamoon | last post by:
Hi, I'm doing a simple compiler with C as a target language. My language uses the possibility to declare variables anywhere in a block with scope to the end of the block. As I remembered it this...
6
by: Ian Williamson | last post by:
Greetings, My company has an ASP.NET based enterprise product that is undergoing some changes and I need some community input to help solve a problem. In the current implementation, any given...
2
by: dis_is_eagle | last post by:
Hi.If I define a macro which contains a variable declaration,then during expansion the declaration will not be placed at the beginning of the program,but somwhere within it.How can I overcome it? ...
3
by: Kasrav | last post by:
hey guys it me again i got stuck in the middle of this program. The program starts with a list declaration of these numbers , i have to make sure the program outputs the following 1 The number...
1
dlite922
by: dlite922 | last post by:
Hey Wsup guys, got a problem that right now i'm just scratching my head at. I have a dynamic receipt/invoice that USUALLY (99%) of the time takes up Half of the page at most. My...
2
by: rhino | last post by:
I'm working on a layout that has a variable-height middle section and need some suggestions on how I can make the bottom section adapt to that situation. Basically, I have: - a fixed-length,...
11
by: neovantage | last post by:
Hey all, I have recently started work on div based websites as suggested the great man acoder of this community advise me to learn divs. I made a page using div. In my page i want that content...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.