Re: [PHP-DB] SimpleXML broke while I was sleeping.

2008-12-10 Thread Jack van Zanen
I'll pass we all have a senior moment every now and than :-)


Jack

2008/12/11 Nicholas Mercier <[EMAIL PROTECTED]>

> Jack wins the right to call me an idiot for a long time. WoWhead changed
> their configuration slightly I think, that is what messed it up. I believe
> it is working now. Thank you - I was just convinced it was something dumb
> on
> my end.
>
> On Wed, Dec 10, 2008 at 9:44 PM, Chris <[EMAIL PROTECTED]> wrote:
>
> >
> >  This is the error message I now get:
> >> *Warning*: SimpleXMLElement::__construct()
> >> [simplexmlelement.--construct<
> >> http://www.theredshirts.com/test/simplexmlelement.--construct>]:
> >> http%3A%2F%2Fwww.wowhead.com 
> %2F%3Fsearch%3DAngelista%27s%2BSash%26xml:84:
> >> parser error : Entity 'nbsp' not defined in *
> >> /home/thered/public_html/test/config.php* on line *28
> >>
> >
> > Looks like the xml contains ' ' chars now - which are not valid in
> xml
> > context it seems.
> >
> > Not sure if ' ' is valid but you'll have to work it out. Take
> the
> > xml, save it to your desktop, try to show it in IE (if using windows of
> > course :P). It will show errors. Once you work out how to fix it, modify
> > your script accordingly.
> >
> > --
> > Postgresql & php tutorials
> > http://www.designmagick.com/
> >
> >
>



-- 
J.A. van Zanen


Re: [PHP-DB] SimpleXML broke while I was sleeping.

2008-12-10 Thread Nicholas Mercier
Jack wins the right to call me an idiot for a long time. WoWhead changed
their configuration slightly I think, that is what messed it up. I believe
it is working now. Thank you - I was just convinced it was something dumb on
my end.

On Wed, Dec 10, 2008 at 9:44 PM, Chris <[EMAIL PROTECTED]> wrote:

>
>  This is the error message I now get:
>> *Warning*: SimpleXMLElement::__construct()
>> [simplexmlelement.--construct<
>> http://www.theredshirts.com/test/simplexmlelement.--construct>]:
>> http%3A%2F%2Fwww.wowhead.com%2F%3Fsearch%3DAngelista%27s%2BSash%26xml:84:
>> parser error : Entity 'nbsp' not defined in *
>> /home/thered/public_html/test/config.php* on line *28
>>
>
> Looks like the xml contains ' ' chars now - which are not valid in xml
> context it seems.
>
> Not sure if ' ' is valid but you'll have to work it out. Take the
> xml, save it to your desktop, try to show it in IE (if using windows of
> course :P). It will show errors. Once you work out how to fix it, modify
> your script accordingly.
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>
>


Re: [PHP-DB] SimpleXML broke while I was sleeping.

2008-12-10 Thread Chris



This is the error message I now get:
*Warning*: SimpleXMLElement::__construct()
[simplexmlelement.--construct]:
http%3A%2F%2Fwww.wowhead.com%2F%3Fsearch%3DAngelista%27s%2BSash%26xml:84:
parser error : Entity 'nbsp' not defined in *
/home/thered/public_html/test/config.php* on line *28


Looks like the xml contains ' ' chars now - which are not valid in 
xml context it seems.


Not sure if ' ' is valid but you'll have to work it out. Take 
the xml, save it to your desktop, try to show it in IE (if using windows 
of course :P). It will show errors. Once you work out how to fix it, 
modify your script accordingly.


--
Postgresql & php tutorials
http://www.designmagick.com/


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] SimpleXML broke while I was sleeping.

2008-12-10 Thread Jack van Zanen
did they change the source at WoWhead?




2008/12/11 Nicholas Mercier <[EMAIL PROTECTED]>

> So I had a code project that took the name of a piece of equipment in World
> of Warcraft - pulled the XML from WoWhead and pulled the database item
> number from the XML file. It worked for a long while and the code simply
> sat
> around not being used. I went back to pull the project out for inclusion in
> something new and it no longer works.
>
> I wasn't terribly comfortable with XML to begin with so I'm not sure what
> has changed - but here is the code the worked for so long:
>
> function item_num_from_xml($url)
> {
>$xml = new SimpleXMLElement(rawurlencode($url), NULL, TRUE);
>$item_num = $xml->items->item[id];
>return $item_num;
> }
>
>$xml_link = "http://www.wowhead.com/?search=".str_replace(" ", "+",
> $item)."&xml";
>$item_num = item_num_from_xml($xml_link);
>$itemlink = "http://www.wowhead.com/?item=".$item_num;
>
> This is the error message I now get:
> *Warning*: SimpleXMLElement::__construct()
> [simplexmlelement.--construct<
> http://www.theredshirts.com/test/simplexmlelement.--construct>]:
> http%3A%2F%2Fwww.wowhead.com 
> %2F%3Fsearch%3DAngelista%27s%2BSash%26xml:84:
> parser error : Entity 'nbsp' not defined in *
> /home/thered/public_html/test/config.php* on line *28
>
> **Warning*: SimpleXMLElement::__construct()
> [simplexmlelement.--construct<
> http://www.theredshirts.com/test/simplexmlelement.--construct>]:
> pan>  class="moneycopper">64Disenchantable  in *
> /home/thered/public_html/test/config.php* on line *28*
>
> and various other beauties including:
>
> *Fatal error*: Uncaught exception 'Exception' with message 'String could
> not
> be parsed as XML' in /home/thered/public_html/test/config.php:28 Stack
> trace: #0 /home/thered/public_html/test/config.php(28):
> SimpleXMLElement->__construct('http%3A%2F%2Fww...', 0, true) #1
> /home/thered/public_html/test/config.php(105): item_num_from_xml() #2
> /home/thered/public_html/test/display.php(86): display_drops('
> http://www.wowh...') #3 /home/thered/public_html/test/index.php(2):
> include('/home/thered/pu...') #4 {main} thrown in *
> /home/thered/public_html/test/config.php* on line *28
>
>
> First person to point out what stupid mistake I'm making can mock me for a
> long time.
> *
>



-- 
J.A. van Zanen


[PHP-DB] SimpleXML broke while I was sleeping.

2008-12-10 Thread Nicholas Mercier
So I had a code project that took the name of a piece of equipment in World
of Warcraft - pulled the XML from WoWhead and pulled the database item
number from the XML file. It worked for a long while and the code simply sat
around not being used. I went back to pull the project out for inclusion in
something new and it no longer works.

I wasn't terribly comfortable with XML to begin with so I'm not sure what
has changed - but here is the code the worked for so long:

function item_num_from_xml($url)
{
$xml = new SimpleXMLElement(rawurlencode($url), NULL, TRUE);
$item_num = $xml->items->item[id];
return $item_num;
}

$xml_link = "http://www.wowhead.com/?search=".str_replace(" ", "+",
$item)."&xml";
$item_num = item_num_from_xml($xml_link);
$itemlink = "http://www.wowhead.com/?item=".$item_num;

This is the error message I now get:
*Warning*: SimpleXMLElement::__construct()
[simplexmlelement.--construct]:
http%3A%2F%2Fwww.wowhead.com%2F%3Fsearch%3DAngelista%27s%2BSash%26xml:84:
parser error : Entity 'nbsp' not defined in *
/home/thered/public_html/test/config.php* on line *28

**Warning*: SimpleXMLElement::__construct()
[simplexmlelement.--construct]:
pan> 64Disenchantable  in *
/home/thered/public_html/test/config.php* on line *28*

and various other beauties including:

*Fatal error*: Uncaught exception 'Exception' with message 'String could not
be parsed as XML' in /home/thered/public_html/test/config.php:28 Stack
trace: #0 /home/thered/public_html/test/config.php(28):
SimpleXMLElement->__construct('http%3A%2F%2Fww...', 0, true) #1
/home/thered/public_html/test/config.php(105): item_num_from_xml() #2
/home/thered/public_html/test/display.php(86): display_drops('
http://www.wowh...') #3 /home/thered/public_html/test/index.php(2):
include('/home/thered/pu...') #4 {main} thrown in *
/home/thered/public_html/test/config.php* on line *28


First person to point out what stupid mistake I'm making can mock me for a
long time.
*