How would I go about writing an XML schema, where the elements would be permitted for use mixed with elements from another namespace?
Specifically, if I want to use some elements for templating in an XHTML document as such:
<!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" xmlns:tmp="http://www.example.com/~/template">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<div id="idName">
<tmp:region name="regionName">
<div class="className">
<h1>
<tmp:data name="dataName1">
<tmp:format type="formatType">
<tmp:param name="paramName" value="paramValue" />
<tmp:param name="paramName" value="paramValue" />
</tmp:format>
</tmp:data>
</h1>
<div>
<tmp:data name="dataName2" />
</div>
</div>
</tmp:region>
</div>
</body>
</html>
I don't want anyone to write the schema, I'm in the midst of doing that (I think correctly) but as mentioned, how could ensure that elements from the tmp namespace can be used as shown in the example? What would I need to include or omit from the XSD, or elsewhere?
If you want anything somewhere, you can use xs:any :
<xs:any processContent="skip" namespace="http://www.foo.com/hello/world"/>
... to allow any element from the provided namespace, for instance.
Related
I am trying to read an rss feed in asp.net. I found the follow code to get me started. the line:
WebRequest request=WebRequest.Create("myfeedurl");
Returns the error "Declaration Expected." I can't for the life of me figure out what could be wrong or what Declaration Expected means. Any help would be greatly appreciated I posted everything I have in the section below.
<%#LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%# Import Namespace="System.Xml" %>
<%# Import Namespace="System.IO" %>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<script runat="server">
WebRequest request=WebRequest.Create("myfeedurl");
WebRequest response=request.GetResponse();
Stream rssStream=response.GetResponseStream();
XMLDocument xmlDoc=new XMLDocument();
xmlDoc.Load(rssStream);
</script>
</body>
</html>
You are trying C# code in VB.Net.
Your code should be:
Dim request As WebRequest = WebRequest.Create("myfeedurl")
So I'm using a jQuery plug-in called Coin Slider. The slideshow seems to be working fine but I want to connect it with a database that I have created in the App_Date folder in Visual Studio 2010.
When clicked on a certain picture, I want the system to search the table in the database using the description of that particular image in the slideshow as a keyword. If the item exists in the database, it would go to the website mentioned in the href. Otherwise, it would display "item not found".
All I've done is make the slideshow.
<!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 runat="server">
<title></title>
<script src="js/jquery-1.9.1.js" type="text/javascript"></script>
<script src="css/coin-slider/coin-slider.min.js" type="text/javascript"></script>
<link href="css/coin-slider/coin-slider-styles.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
$(document).ready(function () {
$('#coin-slider').coinslider();
});
</script>
</head>
<body>
<div id='coin-slider'>
<a href="the first website goes here" target="_blank">
<img src='1.jpg' >
<span>
Description goes here
</span>
</a>
<a href="the second website goes here">
<img src='2.jpg' >
<span>
Description goes here
</span>
</a>
</div>
</body>
</html>
Any help would be appreciated.
I have a file upload control in asp.net which is used to upload image file. Now what I want is I have image control so when a user uploads a file, The image from that file should be visible in the image control before it is really upload on the server. When ever user changes the file, the change should be reflected in that image control. I dont want to use any additional button other than file upload control.
Is there any way to do this with javascript??
I think thats possible in HTML5 supported browsers
check the HTML5 FILE API http://www.w3.org/TR/FileAPI/
This works in FF3+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>input type=file & Firefox 3</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js" type="text/javascript"></script>
</head>
<body>
<h1>This works in Firefox 3+</h1>
<script type="text/javascript">
// <![CDATA[
function inputFileOnChange() {
if (document.getElementById('fichier').files) {
$("#dvFileName").html(document.getElementById('fichier').files.item(0).name);
$("#imgImage").attr("src" ,document.getElementById('fichier').files.item(0).getAsDataURL());
};
};
// ]]>
</script>
<div>
<input type="file" name="fichier" id="fichier" onchange="inputFileOnChange();" />
<br /><br />
<img id="imgImage" src="" width="200" height="200" alt="" />
<div id="dvFileName">
</div>
</div>
</body>
</html>
Can we use Content place holder within the head section of a master page?
for example :
<head runat="server">
<title>Untitled Page</title>
<asp:ContentPlaceHolder id="ContentPlaceHolder2" runat="server">
</asp:ContentPlaceHolder>
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
The short answer is yes. Is it not working for you?
You can use ContentPlaceHolder within the head section of a master page. I'm sending you a working example, out of my project. Make sure you set the attribute runat="server" for head tag. You can also have multiple ContentPlaceHolders within the head tag. see example and enjoy :)
<head ID="Head1" runat="server" Visible="true">
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<!--PageTitle_START-->
<title>
<asp:ContentPlaceHolder ID="PlaceHolderPageTitle" runat="server></asp:ContentPlaceHolder>
</title>
<!--PageTitle_END-->
<asp:ContentPlaceHolder ID="PlaceHolderHeaderScripts" runat="server"></asp:ContentPlaceHolder>
</head>
As long as the <head> tag has a runat=”server” attribute defined, a content page can programmatically add to the <head> section of an ASPX page. The following is perfectly valid:
<head runat="server">
<asp:ContentPlaceHolder runat="server" id="headerPlaceHolder" />
</head>
I am using JQuery for the first time today. I can't make it to work (It simple doesnt show up). I want to display inline content using Thickbox (Eventually I will be displaying a PDF in an iframe). I have included all the javascript and css files etc. and referenced them as in code below.
<%# Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="JQueryLearning._Default" %>
<!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 runat="server">
<title>Untitled Page</title>
<script src="Scripts/thickbox.js" type="text/javascript"></script>
<script src="Scripts/thickbox-compressed.js" type="text/javascript"></script>
<script src="Scripts/jquery-1.4.2.min.js" type="text/javascript"></script>
<link href="App_Themes/Theme/Css/thickbox.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<div>
<a href="#TB_inline?height=50&width=300&inlineId=hiddenModalContent"
title="Simple Demo" class="thickbox">Show hidden content.</a>
<div id="hiddenModalContent" style="display: none;">
<div style="text-align: center;">
Hello ThickBox!</div>
</div>
</div>
</form>
</body>
</html>
Am I missing something?
Thanks,
Ali
I think you need to alter the sequence of the script files, otherwise they won't work properly:
<script src="Scripts/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="Scripts/thickbox.js" type="text/javascript"></script>
<script src="Scripts/thickbox-compressed.js" type="text/javascript"></script>
<link href="App_Themes/Theme/Css/thickbox.css" rel="stylesheet" type="text/css" />
Also: Aren't "thickbox.js" and "thickbox-compressed.js" different compression formats of the same module? In that case, you can omit one of them. If you want to debug inside the js, you need "thickbox.js", otherwise "thickbox-compressed.js" is sufficient.