MYSQL ExtractValue from XML returning large blank -


Trying to use the ExtractValue MYSQL function to return a block from the XML stored in a column of my database I am here. Table document (ID is not anattractive, the primary primary key, not application_id int, content content is not faucet) to create

  in the table  

; Insert

:

  in document values ​​(tap, 1, '& lt ;? xml version = "1.0" encoding = "ISO-8859 -1 Haiti Potter & lt; / title & gt; Price & gt; 29.99 & lt; / gt; Price & gt; Book & gt; & gt; Title Lang = "eng" & gt; Learning XML & lt; / title & Gt; & lt; price & gt; 39.95 & lt; / price & gt; & lt; / book & gt; & lt; / bookstore & gt; ');   

query : from the

  document in @ xml; select Extract Value (@xml, '/ bookstore');   

The second query is a very large empty text Gives space It seems like almost empty space should be back and interesting when I use a xpath which should return a small result, the blank area shrinks.

I have some issues with this issue Appreciate the help and would be happy to provide more information or to try to do anything.

It is not what extract valle is to extract specific values, floods No element.

Here is an example using extract value with your sample XML string to extract value values:

  mysql> Set @ xml = '& lt ;? XML version = "1.0" encoding = "ISO-8859-1"? & Gt; '& Gt; & Lt; Bookshop & gt; '& Gt; & Lt; Book & gt; '& Gt; & Lt; Title lang = "eng" & gt; Harry Potter & lt; / Title & gt; '& Gt; & Lt; Price & gt; 29.99 & lt; / Pricing & gt; '& Gt; & Lt; / Book & gt; '& Gt; & Lt; Book & gt; '& Gt; & Lt; Title = lang = "eng" & gt; Learning XML & lt; / Title & gt; '& Gt; & Lt; Price & gt; 39.95 & lt; / Pricing & gt; '& Gt; & Lt; / Book & gt; '& Gt; & Lt; / Bookstore & gt; '; The query is ok, affecting 0 rows (0.00 seconds) mysql & gt; Mysql & gt; Select Extract Value (@xml, '/ bookstore / book / price'); + --------------------------------------------- + | Extract Value (@xml, '/ bookstore / book / price'). + --------------------------------------------- + | 29.9 9 39.95 + --------------------------------------------- in + 1 line Set (0.00 seconds)    

Comments