Solved

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

Posted on 2007-03-21
7
700 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JQuery tracking event. 3 55
XML filtering Windows Event Viewer 10 45
Problem to page 4 69
read an xml file in perl 2 14
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
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.
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…

929 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

13 Experts available now in Live!

Get 1:1 Help Now