Showing posts with label operation. Show all posts
Showing posts with label operation. Show all posts

Tuesday, March 20, 2012

[XML Task] Error: An error occurred with the following error message: There are multiple root el

I'm trying to use an XML Task to do a simple XSLT operation, but it fails with this error message:

[XML Task] Error: An error occurred with the following error message: "There are multiple root elements. Line 5, position 2.".

The source XML file validates fine and I've successfully used it as the XML Source in a data flow task to load some SQL Server tables. It has very few line breaks, so the first 5 lines are pretty long: almost 4000 characters, including 34 start-tags, 19 end-tags, and 2 empty element tags. Here's the very beginning of it:

<?xml version="1.0" encoding="UTF-8"?>
<ESDU releaselevel="2006-02" createdate="26 May 2006"><package id="1" title="_standard" shorttitle="_standard" filename="pk_stan" supplementdate="01/05/2005" supplementlevel="1"><abstract><![CDATA[This package contains the standard ESDU Series.]]></abstract>

There is only 1 ESDU root element and only 1 package element.

Of course, the XSLT stylesheet is also an XML document in its own right. I specify it directly in the XML Task:

<?xml version="1.0" encoding="UTF-8"?>

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

<xsl:template name="identity" match="@.*|node()">
<xsl:copy>
<xsl:apply-templates select="@.*|node()"/>
</xsl:copy>
</xsl:template>

<xsl:template match="kw">
<xsl:copy>
<xsl:apply-templates select="@.*"/>
<xsl:attribute name="ihs_cats_seq" select="position()"/>
<xsl:apply-templates select="node()"/>
</xsl:copy>
</xsl:template>

</xsl:stylesheet>

Its 5th line is the first xsl:template element.

What is going on here? I do not see multiple root elements in either the XML document or the XSLT stylesheet.

Thanks!

Kevin Rodgers wrote:

I'm trying to use an XML Task to do a simple XSLT operation, but it fails with this error message:

[XML Task] Error: An error occurred with the following error message: "There are multiple root elements. Line 5, position 2.".

The source XML file validates fine and I've successfully used it as the XML Source in a data flow task to load some SQL Server tables. It has very few line breaks, so the first 5 lines are pretty long: almost 4000 characters, including 34 start-tags, 19 end-tags, and 2 empty element tags. Here's the very beginning of it:

<?xml version="1.0" encoding="UTF-8"?>
<ESDU releaselevel="2006-02" createdate="26 May 2006"><package id="1" title="_standard" shorttitle="_standard" filename="pk_stan" supplementdate="01/05/2005" supplementlevel="1"><abstract><![CDATA[This package contains the standard ESDU Series.]]></abstract>

There is only 1 ESDU root element and only 1 package element.

Of course, the XSLT stylesheet is also an XML document in its own right. I specify it directly in the XML Task:

<?xml version="1.0" encoding="UTF-8"?>

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

<xsl:template name="identity" match="@.*|node()">
<xsl:copy>
<xsl:apply-templates select="@.*|node()"/>
</xsl:copy>
</xsl:template>

<xsl:template match="kw">
<xsl:copy>
<xsl:apply-templates select="@.*"/>
<xsl:attribute name="ihs_cats_seq" select="position()"/>
<xsl:apply-templates select="node()"/>
</xsl:copy>
</xsl:template>

</xsl:stylesheet>

Its 5th line is the first xsl:template element.

What is going on here? I do not see multiple root elements in either the XML document or the XSLT stylesheet.

Thanks!

Well of course as soon as I posted that I found an obvious bug: the xsl:stylesheet start tag should not be an empty element tag. But fixing that to:

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

leads to an even more obscure error message:

[XML Task] Error: An error occurred with the following error message: "XSLT compile error.".

|||

Kevin Rodgers wrote:

Kevin Rodgers wrote:

I'm trying to use an XML Task to do a simple XSLT operation, but it fails with this error message:

[XML Task] Error: An error occurred with the following error message: "There are multiple root elements. Line 5, position 2.".

The source XML file validates fine and I've successfully used it as the XML Source in a data flow task to load some SQL Server tables. It has very few line breaks, so the first 5 lines are pretty long: almost 4000 characters, including 34 start-tags, 19 end-tags, and 2 empty element tags. Here's the very beginning of it:

<?xml version="1.0" encoding="UTF-8"?>
<ESDU releaselevel="2006-02" createdate="26 May 2006"><package id="1" title="_standard" shorttitle="_standard" filename="pk_stan" supplementdate="01/05/2005" supplementlevel="1"><abstract><![CDATA[This package contains the standard ESDU Series.]]></abstract>

There is only 1 ESDU root element and only 1 package element.

Of course, the XSLT stylesheet is also an XML document in its own right. I specify it directly in the XML Task:

<?xml version="1.0" encoding="UTF-8"?>

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

<xsl:template name="identity" match="@.*|node()">
<xsl:copy>
<xsl:apply-templates select="@.*|node()"/>
</xsl:copy>
</xsl:template>

<xsl:template match="kw">
<xsl:copy>
<xsl:apply-templates select="@.*"/>
<xsl:attribute name="ihs_cats_seq" select="position()"/>
<xsl:apply-templates select="node()"/>
</xsl:copy>
</xsl:template>

</xsl:stylesheet>

Its 5th line is the first xsl:template element.

What is going on here? I do not see multiple root elements in either the XML document or the XSLT stylesheet.

Thanks!

Well of course as soon as I posted that I found an obvious bug: the <xsl:stylesheet> start tag should not be an empty element tag. But fixing that to:

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

leads to an even more obscure error message:

[XML Task] Error: An error occurred with the following error message: "XSLT compile error.".

Sorry to follow up again to my own question, but when I tried to run the transformation via Saxon (the free, open-source, fully compliant XSLT processor) it helpfully reported:

Warning: Running an XSLT 1.0 stylesheet with an XSLT 2.0 processor

And changing the xsl:stylesheet start tag to:

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

did indeed allow SSIS to execute the XML task succesfully. But(!) the stylesheet did not work correctly. With Saxon, it correctly adds ihs_cats_seq attributes to each kw element, e.g.

<keywords><kw ihs_cats_seq="1">AERODYNAMICS</kw><kw ihs_cats_seq="2">AMENDMENT</kw><kw ihs_cats_seq="3">LOCATION</kw><kw ihs_cats_seq="4">ORGANISATION</kw><kw ihs_cats_seq="5">RECORD</kw><kw ihs_cats_seq="6">SCHEDULE</kw><kw ihs_cats_seq="7">SERIES</kw></keywords>

But SSIS adds ihs_cats_seq="" to each kw start-tag. Is there a known bug with the position() XPath function?

|||

I was able to get an answer in a different forum:

http://forums.microsoft.com/msdn/showpost.aspx?postid=654370

[XML Task] Error: An error occurred with the following error message: There are multiple roo

I'm trying to use an XML Task to do a simple XSLT operation, but it fails with this error message:

[XML Task] Error: An error occurred with the following error message: "There are multiple root elements. Line 5, position 2.".

The source XML file validates fine and I've successfully used it as the XML Source in a data flow task to load some SQL Server tables. It has very few line breaks, so the first 5 lines are pretty long: almost 4000 characters, including 34 start-tags, 19 end-tags, and 2 empty element tags. Here's the very beginning of it:

<?xml version="1.0" encoding="UTF-8"?>
<ESDU releaselevel="2006-02" createdate="26 May 2006"><package id="1" title="_standard" shorttitle="_standard" filename="pk_stan" supplementdate="01/05/2005" supplementlevel="1"><abstract><![CDATA[This package contains the standard ESDU Series.]]></abstract>

There is only 1 ESDU root element and only 1 package element.

Of course, the XSLT stylesheet is also an XML document in its own right. I specify it directly in the XML Task:

<?xml version="1.0" encoding="UTF-8"?>

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

<xsl:template name="identity" match="@.*|node()">
<xsl:copy>
<xsl:apply-templates select="@.*|node()"/>
</xsl:copy>
</xsl:template>

<xsl:template match="kw">
<xsl:copy>
<xsl:apply-templates select="@.*"/>
<xsl:attribute name="ihs_cats_seq" select="position()"/>
<xsl:apply-templates select="node()"/>
</xsl:copy>
</xsl:template>

</xsl:stylesheet>

Its 5th line is the first xsl:template element.

What is going on here? I do not see multiple root elements in either the XML document or the XSLT stylesheet.

Thanks!

Kevin Rodgers wrote:

I'm trying to use an XML Task to do a simple XSLT operation, but it fails with this error message:

[XML Task] Error: An error occurred with the following error message: "There are multiple root elements. Line 5, position 2.".

The source XML file validates fine and I've successfully used it as the XML Source in a data flow task to load some SQL Server tables. It has very few line breaks, so the first 5 lines are pretty long: almost 4000 characters, including 34 start-tags, 19 end-tags, and 2 empty element tags. Here's the very beginning of it:

<?xml version="1.0" encoding="UTF-8"?>
<ESDU releaselevel="2006-02" createdate="26 May 2006"><package id="1" title="_standard" shorttitle="_standard" filename="pk_stan" supplementdate="01/05/2005" supplementlevel="1"><abstract><![CDATA[This package contains the standard ESDU Series.]]></abstract>

There is only 1 ESDU root element and only 1 package element.

Of course, the XSLT stylesheet is also an XML document in its own right. I specify it directly in the XML Task:

<?xml version="1.0" encoding="UTF-8"?>

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

<xsl:template name="identity" match="@.*|node()">
<xsl:copy>
<xsl:apply-templates select="@.*|node()"/>
</xsl:copy>
</xsl:template>

<xsl:template match="kw">
<xsl:copy>
<xsl:apply-templates select="@.*"/>
<xsl:attribute name="ihs_cats_seq" select="position()"/>
<xsl:apply-templates select="node()"/>
</xsl:copy>
</xsl:template>

</xsl:stylesheet>

Its 5th line is the first xsl:template element.

What is going on here? I do not see multiple root elements in either the XML document or the XSLT stylesheet.

Thanks!

Well of course as soon as I posted that I found an obvious bug: the xsl:stylesheet start tag should not be an empty element tag. But fixing that to:

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

leads to an even more obscure error message:

[XML Task] Error: An error occurred with the following error message: "XSLT compile error.".

|||

Kevin Rodgers wrote:

Kevin Rodgers wrote:

I'm trying to use an XML Task to do a simple XSLT operation, but it fails with this error message:

[XML Task] Error: An error occurred with the following error message: "There are multiple root elements. Line 5, position 2.".

The source XML file validates fine and I've successfully used it as the XML Source in a data flow task to load some SQL Server tables. It has very few line breaks, so the first 5 lines are pretty long: almost 4000 characters, including 34 start-tags, 19 end-tags, and 2 empty element tags. Here's the very beginning of it:

<?xml version="1.0" encoding="UTF-8"?>
<ESDU releaselevel="2006-02" createdate="26 May 2006"><package id="1" title="_standard" shorttitle="_standard" filename="pk_stan" supplementdate="01/05/2005" supplementlevel="1"><abstract><![CDATA[This package contains the standard ESDU Series.]]></abstract>

There is only 1 ESDU root element and only 1 package element.

Of course, the XSLT stylesheet is also an XML document in its own right. I specify it directly in the XML Task:

<?xml version="1.0" encoding="UTF-8"?>

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

<xsl:template name="identity" match="@.*|node()">
<xsl:copy>
<xsl:apply-templates select="@.*|node()"/>
</xsl:copy>
</xsl:template>

<xsl:template match="kw">
<xsl:copy>
<xsl:apply-templates select="@.*"/>
<xsl:attribute name="ihs_cats_seq" select="position()"/>
<xsl:apply-templates select="node()"/>
</xsl:copy>
</xsl:template>

</xsl:stylesheet>

Its 5th line is the first xsl:template element.

What is going on here? I do not see multiple root elements in either the XML document or the XSLT stylesheet.

Thanks!

Well of course as soon as I posted that I found an obvious bug: the <xsl:stylesheet> start tag should not be an empty element tag. But fixing that to:

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

leads to an even more obscure error message:

[XML Task] Error: An error occurred with the following error message: "XSLT compile error.".

Sorry to follow up again to my own question, but when I tried to run the transformation via Saxon (the free, open-source, fully compliant XSLT processor) it helpfully reported:

Warning: Running an XSLT 1.0 stylesheet with an XSLT 2.0 processor

And changing the xsl:stylesheet start tag to:

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

did indeed allow SSIS to execute the XML task succesfully. But(!) the stylesheet did not work correctly. With Saxon, it correctly adds ihs_cats_seq attributes to each kw element, e.g.

<keywords><kw ihs_cats_seq="1">AERODYNAMICS</kw><kw ihs_cats_seq="2">AMENDMENT</kw><kw ihs_cats_seq="3">LOCATION</kw><kw ihs_cats_seq="4">ORGANISATION</kw><kw ihs_cats_seq="5">RECORD</kw><kw ihs_cats_seq="6">SCHEDULE</kw><kw ihs_cats_seq="7">SERIES</kw></keywords>

But SSIS adds ihs_cats_seq="" to each kw start-tag. Is there a known bug with the position() XPath function?

|||

I was able to get an answer in a different forum:

http://forums.microsoft.com/msdn/showpost.aspx?postid=654370

sql

Sunday, March 11, 2012

[SQL 2005] How do I prevent or hide this warning message?

"Warning: Null value is eliminated by an aggregate or other SET operation."
i keep having this message while having some joint statement.
is there a way to prevent this or even hide this message?Check ANSI_WARNINGS in BoL|||sorry, may I know what is BoL? thanks :)|||bol = books online

it's the documentation for sql server.

Saturday, February 25, 2012

[INSTALL SQL SERVER] GOT A WARNING MESSAGE

[Microsoft SQL server 2000 standard edition server component is not
supported ont this operation system
Only client components will be avaiable for installation ]
my OS is winXP professional edition.
Anything wrong ?
please help
It is not possible to install SQL Server (the server edition) on to a =
desktop OS such as XP Pro. =20
You do have a few options if you need the DBMS installed on your =
computer (for example for development/testing). You can install the =
Personal Edition or the Developer Edition of SQL Server to your desktop =
machine.
--=20
Keith
"Agnes" <agnes@.dynamictech.com.hk> wrote in message =
news:eJd9rxOPEHA.1340@.TK2MSFTNGP12.phx.gbl...
> [Microsoft SQL server 2000 standard edition server component is not
> supported ont this operation system
> Only client components will be avaiable for installation ]
>=20
> my OS is winXP professional edition.
> Anything wrong ?
> please help
>=20
>
|||That's mean I can install to window server2000 but not XP Pro ?
"Keith Kratochvil" <sqlguy.back2u@.comcast.net> ?
news:OCgeK4OPEHA.3124@.TK2MSFTNGP12.phx.gbl ?...
It is not possible to install SQL Server (the server edition) on to a
desktop OS such as XP Pro.
You do have a few options if you need the DBMS installed on your computer
(for example for development/testing). You can install the Personal Edition
or the Developer Edition of SQL Server to your desktop machine.
Keith
"Agnes" <agnes@.dynamictech.com.hk> wrote in message
news:eJd9rxOPEHA.1340@.TK2MSFTNGP12.phx.gbl...
> [Microsoft SQL server 2000 standard edition server component is not
> supported ont this operation system
> Only client components will be avaiable for installation ]
> my OS is winXP professional edition.
> Anything wrong ?
> please help
>
|||> That's mean I can install to window server2000 but not XP Pro ?
That is the expected (and correct) behavior.

> [Microsoft SQL server 2000 standard edition server component is not
> supported ont this operation system
This is a true statement

> Only client components will be avaiable for installation ]
Also a true statement

> my OS is winXP professional edition.
This is your problem. The server editions (Standard and Enterprise) of =
SQL Server do not install on to desktop operating systems. If you want =
to install SQL Server onto your desktop operating system you will need =
to install the Personal Edition, the Developer Edition, or a trial =
edition.

> Anything wrong ?
You are trying to install SQL Server onto an operating system that it =
does not install on.
--=20
Keith
"Agnes" <agnes@.dynamictech.com.hk> wrote in message =
news:%23b76DCPPEHA.3128@.TK2MSFTNGP10.phx.gbl...
> That's mean I can install to window server2000 but not XP Pro ?
>=20
> "Keith Kratochvil" <sqlguy.back2u@.comcast.net> ?
> news:OCgeK4OPEHA.3124@.TK2MSFTNGP12.phx.gbl ?...
> It is not possible to install SQL Server (the server edition) on to a
> desktop OS such as XP Pro.
>=20
> You do have a few options if you need the DBMS installed on your =
computer
> (for example for development/testing). You can install the Personal =
Edition
> or the Developer Edition of SQL Server to your desktop machine.
>=20
> --=20
> Keith
>=20
>=20
> "Agnes" <agnes@.dynamictech.com.hk> wrote in message
> news:eJd9rxOPEHA.1340@.TK2MSFTNGP12.phx.gbl...
>=20
>

[INSTALL SQL SERVER] GOT A WARNING MESSAGE

[Microsoft SQL server 2000 standard edition server component is not
supported ont this operation system
Only client components will be avaiable for installation ]
my OS is winXP professional edition.
Anything wrong '
please helpIt is not possible to install SQL Server (the server edition) on to a =
desktop OS such as XP Pro. =20
You do have a few options if you need the DBMS installed on your =
computer (for example for development/testing). You can install the =
Personal Edition or the Developer Edition of SQL Server to your desktop =
machine.
--=20
Keith
"Agnes" <agnes@.dynamictech.com.hk> wrote in message =
news:eJd9rxOPEHA.1340@.TK2MSFTNGP12.phx.gbl...
> [Microsoft SQL server 2000 standard edition server component is not
> supported ont this operation system
> Only client components will be avaiable for installation ]
>=20
> my OS is winXP professional edition.
> Anything wrong '
> please help
>=20
>|||That's mean I can install to window server2000 but not XP Pro '
"Keith Kratochvil" <sqlguy.back2u@.comcast.net> ?
news:OCgeK4OPEHA.3124@.TK2MSFTNGP12.phx.gbl ?...
It is not possible to install SQL Server (the server edition) on to a
desktop OS such as XP Pro.
You do have a few options if you need the DBMS installed on your computer
(for example for development/testing). You can install the Personal Edition
or the Developer Edition of SQL Server to your desktop machine.
Keith
"Agnes" <agnes@.dynamictech.com.hk> wrote in message
news:eJd9rxOPEHA.1340@.TK2MSFTNGP12.phx.gbl...
> [Microsoft SQL server 2000 standard edition server component is not
> supported ont this operation system
> Only client components will be avaiable for installation ]
> my OS is winXP professional edition.
> Anything wrong '
> please help
>|||> That's mean I can install to window server2000 but not XP Pro '
That is the expected (and correct) behavior.

> [Microsoft SQL server 2000 standard edition server component is not
> supported ont this operation system
This is a true statement

> Only client components will be avaiable for installation ]
Also a true statement

> my OS is winXP professional edition.
This is your problem. The server editions (Standard and Enterprise) of =
SQL Server do not install on to desktop operating systems. If you want =
to install SQL Server onto your desktop operating system you will need =
to install the Personal Edition, the Developer Edition, or a trial =
edition.

> Anything wrong '
You are trying to install SQL Server onto an operating system that it =
does not install on.
--=20
Keith
"Agnes" <agnes@.dynamictech.com.hk> wrote in message =
news:%23b76DCPPEHA.3128@.TK2MSFTNGP10.phx.gbl...
> That's mean I can install to window server2000 but not XP Pro '
>=20
> "Keith Kratochvil" <sqlguy.back2u@.comcast.net> ?
> news:OCgeK4OPEHA.3124@.TK2MSFTNGP12.phx.gbl ?...
> It is not possible to install SQL Server (the server edition) on to a
> desktop OS such as XP Pro.
>=20
> You do have a few options if you need the DBMS installed on your =
computer
> (for example for development/testing). You can install the Personal =
Edition
> or the Developer Edition of SQL Server to your desktop machine.
>=20
> --=20
> Keith
>=20
>=20
> "Agnes" <agnes@.dynamictech.com.hk> wrote in message
> news:eJd9rxOPEHA.1340@.TK2MSFTNGP12.phx.gbl...
>=20
>

[INSTALL SQL SERVER] GOT A WARNING MESSAGE

[Microsoft SQL server 2000 standard edition server component is not
supported ont this operation system
Only client components will be avaiable for installation ]
my OS is winXP professional edition.
Anything wrong '
please helpIt is not possible to install SQL Server (the server edition) on to a =desktop OS such as XP Pro.
You do have a few options if you need the DBMS installed on your =computer (for example for development/testing). You can install the =Personal Edition or the Developer Edition of SQL Server to your desktop =machine.
-- Keith
"Agnes" <agnes@.dynamictech.com.hk> wrote in message =news:eJd9rxOPEHA.1340@.TK2MSFTNGP12.phx.gbl...
> [Microsoft SQL server 2000 standard edition server component is not
> supported ont this operation system
> Only client components will be avaiable for installation ]
> > my OS is winXP professional edition.
> Anything wrong '
> please help
> >|||That's mean I can install to window server2000 but not XP Pro '
"Keith Kratochvil" <sqlguy.back2u@.comcast.net> ?
news:OCgeK4OPEHA.3124@.TK2MSFTNGP12.phx.gbl ?...
It is not possible to install SQL Server (the server edition) on to a
desktop OS such as XP Pro.
You do have a few options if you need the DBMS installed on your computer
(for example for development/testing). You can install the Personal Edition
or the Developer Edition of SQL Server to your desktop machine.
--
Keith
"Agnes" <agnes@.dynamictech.com.hk> wrote in message
news:eJd9rxOPEHA.1340@.TK2MSFTNGP12.phx.gbl...
> [Microsoft SQL server 2000 standard edition server component is not
> supported ont this operation system
> Only client components will be avaiable for installation ]
> my OS is winXP professional edition.
> Anything wrong '
> please help
>|||> That's mean I can install to window server2000 but not XP Pro '
That is the expected (and correct) behavior.
> [Microsoft SQL server 2000 standard edition server component is not
> supported ont this operation system
This is a true statement
> Only client components will be avaiable for installation ]
Also a true statement
> my OS is winXP professional edition.
This is your problem. The server editions (Standard and Enterprise) of =SQL Server do not install on to desktop operating systems. If you want =to install SQL Server onto your desktop operating system you will need =to install the Personal Edition, the Developer Edition, or a trial =edition.
> Anything wrong '
You are trying to install SQL Server onto an operating system that it =does not install on.
-- Keith
"Agnes" <agnes@.dynamictech.com.hk> wrote in message =news:%23b76DCPPEHA.3128@.TK2MSFTNGP10.phx.gbl...
> That's mean I can install to window server2000 but not XP Pro '
> > "Keith Kratochvil" <sqlguy.back2u@.comcast.net> ?
> news:OCgeK4OPEHA.3124@.TK2MSFTNGP12.phx.gbl ?...
> It is not possible to install SQL Server (the server edition) on to a
> desktop OS such as XP Pro.
> > You do have a few options if you need the DBMS installed on your =computer
> (for example for development/testing). You can install the Personal =Edition
> or the Developer Edition of SQL Server to your desktop machine.
> > -- > Keith
> > > "Agnes" <agnes@.dynamictech.com.hk> wrote in message
> news:eJd9rxOPEHA.1340@.TK2MSFTNGP12.phx.gbl...
> > [Microsoft SQL server 2000 standard edition server component is not
> > supported ont this operation system
> > Only client components will be avaiable for installation ]
> >
> > my OS is winXP professional edition.
> > Anything wrong '
> > please help
> >
> >
> >