Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Duplicate attribute problem

124 views
Skip to first unread message

FMAS

unread,
Dec 6, 2009, 12:28:09 PM12/6/09
to
As a newbie I am trying to transform an XLIFF file, but I get a
duplicate attribute error in the following code:

<?xml version="1.0" encoding="utf-8"?>
<xliff
xmlns:sdl="http://sdl.com/FileTypes/SdlXliff/1.0" version="1.2"
sdl:version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns="urn:oasis:names:tc:xliff:document:1.2">

I have tried without the sdl or xsl namespace, but then I get other
parsing errors.

What am I doing wrong here?

Julian F. Reschke

unread,
Dec 6, 2009, 5:27:36 PM12/6/09
to

You have a duplicate attribute ("version").

I think this is a case where the error message really is helpful, isn't it?

FMAS

unread,
Dec 7, 2009, 12:32:39 PM12/7/09
to
On 6 Dez., 23:27, "Julian F. Reschke" <julian.resc...@nospam-

greenbytes.de> wrote:
> FMAS wrote:
> > As a newbie I am trying to transform an XLIFF file, but I get a
> >duplicate attributeerror in the following code:

>
> > <?xml version="1.0" encoding="utf-8"?>
> > <xliff
> > xmlns:sdl="http://sdl.com/FileTypes/SdlXliff/1.0" version="1.2"
> >sdl:version="1.0"
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
> > xmlns="urn:oasis:names:tc:xliff:document:1.2">
>
> > I have tried without thesdlorxslnamespace, but then I get other

> > parsing errors.
>
> > What am I doing wrong here?
>
> You have aduplicate attribute("version").

>
> I think this is a case where the error message really is helpful, isn't it?

I had thought indeed that the "version=1.0 may be the cause of my
problem because the line/column information pointed at it, but if I
delete the version attribute I get the error message:
"Required attribute '{http://www.w3.org/1999/XSL/Transform}version' is
missing."
If I just modify it I get a "duplicate attribute " error message.
I do not really understand what the problem is.

Martin Honnen

unread,
Dec 7, 2009, 12:38:10 PM12/7/09
to
FMAS wrote:

> I had thought indeed that the "version=1.0 may be the cause of my
> problem because the line/column information pointed at it, but if I
> delete the version attribute I get the error message:
> "Required attribute '{http://www.w3.org/1999/XSL/Transform}version' is
> missing."
> If I just modify it I get a "duplicate attribute " error message.
> I do not really understand what the problem is.

If you want to write an XSLT stylesheet with a literal result element as
the root element then it has to have an xsl:version attribute in the
namespace http://www.w3.org/1999/XSL/Transform e.g.

<xliff
xmlns:sdl="http://sdl.com/FileTypes/SdlXliff/1.0" version="1.2"
sdl:version="1.0"

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


xmlns="urn:oasis:names:tc:xliff:document:1.2">

Or you need to write a stylesheet where the root element is
xsl:stylesheet (or xsl:transform) and then has a 'version' attribute in
no namespace.

--

Martin Honnen --- MVP XML
http://msmvps.com/blogs/martin_honnen/

Neil Smith [MVP Digital Media]

unread,
Dec 28, 2009, 7:02:24 AM12/28/09
to


You have 2 version attributes in the default (xmlns) namespace, and
may only have one.

So first you had 2 identical attributes (dfisallowed in XML) which is
what the parser is complaining about. Then you specfied a value "1.2"
for the version attribute, which again isn't valid. Probably a
cut+paste error, but you need to check closely what you're pasting.

It looks to me like your intention is to process the items as XSL, so
there should be a single version attribute which would be either

version="1.0"
or
version="2.0"

Those are the only valid values I'm aware of for XSLT, so next remove
the spare version="1.2" attribute first, then see if the stylesheet
parses when it contains version="1.0" only. Change if to "2.0" if you
are using XSLT2 procesing features.

HTH
Cheers - Neil
------------------------------------------------
Digital Media MVP : 2004-2009
http://mvp.support.microsoft.com/mvpfaqs

0 new messages