Hello all.
I'm trying to create an xml schema collection from a file, using this code
DROP XML SCHEMA COLLECTION gandy
DECLARE @.xml xml
SELECT @.xml = BulkColumn FROM openrowset(Bulk 'P04-S01.xsl', SINGLE_BLOB) as
x
CREATE XML SCHEMA COLLECTION gandy AS @.xml
The problem is that after running this statements SQL Server 2005 gives this
error
Msg 2378, Level 16, State 1, Line 4
Expected XML schema document
What is the problem?
The xslt document is well formed and working (I used it with Altova XML Spy
to apply the transformation).
Thanks
André Giltry something like this
declare @.string varchar(MAX)
declare @.xml varchar(MAX)
select @.string ='Create xml Schema Collection MySchemaCollections as '''
SELECT @.xml = replace(BulkColumn,CHAR(39),CHAR(39)+CHA
R(39)) FROM
openrowset(Bulk ''P04-S01.xsl'', SINGLE_BLOB) as x
select @.string=@.string +@.xml +''''
--print @.string
exec(@.string)
I am not sure about the wisdom of doing something like this though.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Andr Gil" <AndrGil@.discussions.microsoft.com> wrote in message
news:8E8AB17D-4D56-442B-A9D1-0459E86A1215@.microsoft.com...
> Hello all.
> I'm trying to create an xml schema collection from a file, using this code
> DROP XML SCHEMA COLLECTION gandy
> DECLARE @.xml xml
> SELECT @.xml = BulkColumn FROM openrowset(Bulk 'P04-S01.xsl', SINGLE_BLOB)
> as x
> CREATE XML SCHEMA COLLECTION gandy AS @.xml
> The problem is that after running this statements SQL Server 2005 gives
> this
> error
> Msg 2378, Level 16, State 1, Line 4
> Expected XML schema document
> What is the problem?
> The xslt document is well formed and working (I used it with Altova XML
> Spy
> to apply the transformation).
> Thanks
> Andr Gil|||Interrupting my skiing :-)
Why would you want to load an XSLT transformation as a schema file? They
have nothing in common.
Try loading an actual XML Schema file...
Best regards
Michael
"Andr Gil" <AndrGil@.discussions.microsoft.com> wrote in message
news:8E8AB17D-4D56-442B-A9D1-0459E86A1215@.microsoft.com...
> Hello all.
> I'm trying to create an xml schema collection from a file, using this code
> DROP XML SCHEMA COLLECTION gandy
> DECLARE @.xml xml
> SELECT @.xml = BulkColumn FROM openrowset(Bulk 'P04-S01.xsl', SINGLE_BLOB)
> as x
> CREATE XML SCHEMA COLLECTION gandy AS @.xml
> The problem is that after running this statements SQL Server 2005 gives
> this
> error
> Msg 2378, Level 16, State 1, Line 4
> Expected XML schema document
> What is the problem?
> The xslt document is well formed and working (I used it with Altova XML
> Spy
> to apply the transformation).
> Thanks
> Andr Gil
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment