Solved

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

Posted on 2007-03-21
7
692 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
Comment Utility
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
Comment Utility
vivethangaswamy,
So how do I fix this?
TIA
0
 
LVL 12

Assisted Solution

by:jkmyoung
jkmyoung earned 150 total points
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 11

Expert Comment

by:Vivek Thangaswamy
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Do either of you know of a calendar that I can call from two different input statements on a XSL form?
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

743 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

17 Experts available now in Live!

Get 1:1 Help Now