Solved

Namespace for prefix 'dg' has not been declared Error

Posted on 2009-07-14
7
1,825 Views
Last Modified: 2013-11-18
When I run an ant task to generate XSLs, I get the following error...

    Namespace for prefix 'dg' has not been declared.

The error seems to be coming from the datagen-schematron.xsl file, but I am unsure of this.  I am attaching this file, and several other files I believe are pertinent.

I am very unfamiliar with this process, as I am simply running a process created by someone else.  I have only a modest amount of background knowledge.  Hopefully, someone can tell me what to check, study or do to solve this problem.
Buildfile: C:\eclipse\Workspace\datagen\build.xml

create-xsl:

check-lint-uptodate:

create-lint:

     [xslt] Transforming into C:\eclipse\Workspace\datagen\xsl-gen

     [xslt] Processing C:\eclipse\Workspace\datagen\template\lint.xml to C:\eclipse\Workspace\datagen\xsl-gen\lint.xsl

     [xslt] Loading stylesheet C:\eclipse\Workspace\datagen\lib\dev\schematron\datagen-schematron.xsl

     [xslt] : Error! Namespace for prefix 'dg' has not been declared.

     [xslt] Failed to process null
 

BUILD FAILED

C:\eclipse\Workspace\datagen\build.xml:79: The following error occurred while executing this line:

C:\eclipse\Workspace\datagen\build.xml:107: javax.xml.transform.TransformerException: java.lang.RuntimeException: Namespace for prefix 'dg' has not been declared.
 

Total time: 906 milliseconds

Open in new window

DataGen-build-xml
DataGen-gen-xml
DataGen-datagen-schematron-xsl
0
Comment
Question by:LarryAndro
  • 4
  • 2
7 Comments
 
LVL 1

Author Comment

by:LarryAndro
Comment Utility
I forgot to mention that in the Datagen-Schematron.xsl file (attached) the 'dg' namespace appears to be declared.  So, I am unsure why the error message...

    Namespace for prefix 'dg' has not been declared.

is occurring.
0
 
LVL 11

Assisted Solution

by:kmartin7
kmartin7 earned 300 total points
Comment Utility
Is the dg namespace declared in lint.xml?
0
 
LVL 1

Author Comment

by:LarryAndro
Comment Utility
The top section of lint.xml is included in the code snippet section.  Whether the prefix="dg" line is proper declaring, I don't know.
<?xml version="1.0" encoding="UTF-8"?>

<!-- $Id: lint.xml,v 1.29 2005/06/21 18:20:52 kackley Exp $ -->

<schema 

    xmlns="http://www.ascc.net/xml/schematron"        

    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

    >

  <title>Datagen validation schema</title>

  

  <ns prefix="dg" uri="http://vha.med.va.gov/gov/va/datagen"/>

...

...

...

...

Open in new window

0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 60

Accepted Solution

by:
Geert Bormans earned 200 total points
Comment Utility
mmh, you are actually generating xslt by using xslt,
it is likely that the error occurs in the actual execution of the generated xslt.

when you create the root element for the generated stylesheet
(axsl:stylesheet) but that part of the stylesheet is not included,
you have to make sure that the namespace node for dg is copied there too.
That seems a likely cause to me
0
 
LVL 11

Assisted Solution

by:kmartin7
kmartin7 earned 300 total points
Comment Utility
So lint.xml is actually a schematrob schema? What document(s) are you validating to this?

it is difficult to say from the files you provided where the error is occurring. I see you are using ant, java and even DTD, so it could be derived from any one of those points of contact. You do have the namespace declared in DataGen-datagen-schematron-xsl, so that isn't where the error is occurring (I don't think).

Sorry I couldn't be of more help.

kmartin7
0
 
LVL 1

Author Comment

by:LarryAndro
Comment Utility
I will check out your comments tomorrow morning.  (I'll give points, even if I don't find the solution here.)
0
 
LVL 1

Author Comment

by:LarryAndro
Comment Utility
Even with the suggestions above, I am unable to determine the cause of my problem.  I am unsure how to proceed, and I am sure this is because of my lack of knowledge about most of the techniques being used.  (E.g., xslt translation.)  I will have to turn this over to others on my team more familiar with this problem.

I am awarding points.  And, thanks for responding...
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
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.

762 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

6 Experts available now in Live!

Get 1:1 Help Now