Solved

The prefix "DRC" for element "DRC:Calendar" is not bound.

Posted on 2007-03-21
7
716 Views
Last Modified: 2013-11-18
Hello,
I have two pages (ASP and XSL),
The ASP page calls the XSL page and has the following in the head section of the ASP page
<STYLE>
@media all
{
DRC\:Calendar
{
behavior: url(calendar.htc);
}
}
</STYLE>
<link rel="Stylesheet" href="calendar.css" />  

I am trying to add a calendar to an XSLT form.
I am getting the following error:
The prefix "DRC" for element "DRC:Calendar" is not bound.
The example shows this <HTML XMLNS:Prefix1 XMLNS:Prefix2="www.sample.com"> and this for XML
<Prefix: CustomTag ID=sID STYLE="behavior:url('calendar.htc')" /> but this give this error...
Element or attribute do not match QName production: QName::=(NCName':')?NCName.
Not sure if this has anything to do with the error.
Any ideas?

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:sd="http://tempuri.org/ds_ContactList.xsd"
xmlns:msdata="http://tempuri.org/ds_ContactList.xsd"
exclude-result-prefixes="sd msdata"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt">
 
    <!--
        We're outputting HTML 4.0, so set the output method accordingly
    -->
 <xsl:output method="html" version="4.0"/>
 
 <xsl:param name="selfDoc" select="document('')"/>

<SCRIPT type="text/javascript" language="JavaScript">
function onDateSelect1() {
document.form1.startdt1.value = document.form1.MyCalendar1.intervalstart
document.form1.mydiv1.style.visibility = 'hidden'
}
function ShowCalendar1() {
  var e = window.event.srcElement
  document.form1.mydiv1.style.left = e.offsetLeft + e.offsetWidth - document.form1.mydiv1.offsetWidth
  document.form1.mydiv1.style.top = e.offsetTop + e.offsetHeight + 4
  document.form1.mydiv1.style.visibility = 'visible'
  return false;
}
</SCRIPT>
<DIV id="mydiv1" class="style1"
     onmouseover="javascript: this.style.visibility = 'visible'"
     onmouseout="javascript: this.style.visibility = 'hidden'">
<DRC:Calendar id="MyCalendar1"
    dateformat="mmmm, dd yyyy"
    mcount="1"
    dselect="date"
    onintervalselectend="onDateSelect1()"
/>
</DIV>
0
Comment
Question by:TrueBlue
  • 3
  • 3
7 Comments
 
LVL 11

Accepted Solution

by:
Vivek Thangaswamy earned 350 total points
ID: 18769279
Hi

In XML/XSL when you add something with : it will take it as namespace and search for it in your corresponding document.
In your doc it search for DRC: 's namespace. : is to separate your namespace and your tag element

0
 

Author Comment

by:TrueBlue
ID: 18770429
vivethangaswamy,
So how do I fix this?
TIA
0
 
LVL 12

Assisted Solution

by:jkmyoung
jkmyoung earned 150 total points
ID: 18772312
Inside the element, declare the namespace with xmlns like so:

<DRC:Calendar
    xmlns:DRC="http:\\www.somepage.com"
    id="MyCalendar1"
    dateformat="mmmm, dd yyyy"
    mcount="1"
    dselect="date"
    onintervalselectend="onDateSelect1()"
/>

You can also declare the namespace at top in your stylesheet node.
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 11

Expert Comment

by:Vivek Thangaswamy
ID: 18772339
You need to add the DRC' s namesace in the top as you added XSL namespace's...

ex:
xmlns:sd="http://tempuri.org/ds_ContactList.xsd"
xmlns:msdata="http://tempuri.org/ds_ContactList.xsd"
exclude-result-prefixes="sd msdata"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt">
0
 

Author Comment

by:TrueBlue
ID: 18772755
Hi,
I changed the namespace in both places and got the following error:
Top level elements must have a non-null namespace URI
Any ideas?
0
 
LVL 11

Expert Comment

by:Vivek Thangaswamy
ID: 18772804
Your example is illegal because top-level elements may not have a null namespace URI.

for example refer this links
http://www.biglist.com/lists/xsl-list/archives/200302/msg00819.html
http://www.stylusstudio.com/w3c/xslt/stylesheet-element.htm
0
 

Author Comment

by:TrueBlue
ID: 18772934
Do either of you know of a calendar that I can call from two different input statements on a XSL form?
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now