?
Solved

Namespace for prefix 'dg' has not been declared Error

Posted on 2009-07-14
7
Medium Priority
?
1,966 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 1

Author Comment

by:LarryAndro
ID: 24853412
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 1200 total points
ID: 24853685
Is the dg namespace declared in lint.xml?
0
 
LVL 1

Author Comment

by:LarryAndro
ID: 24853812
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
7 Extremely Useful Linux Commands for Beginners

Just getting started with Linux? Here's a quick start guide that has 7 commands that we believe will come in handy.

 
LVL 60

Accepted Solution

by:
Geert Bormans earned 800 total points
ID: 24854782
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 1200 total points
ID: 24854847
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
ID: 24854896
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
ID: 24860547
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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

770 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