[Developers] Freebase wex convert xml to html

Brian Karlak zenkat at metaweb.com
Tue Nov 24 23:16:34 UTC 2009


Hi Steward --

Unfortunately, the code you are using isn't from Freebase, so I can't  
help you out.  We don't have a need internally to translate the  
Wikipedia XML to HTML, so we don't have any experience with this code.

What exactly are you trying to do?  Perhaps there is a simpler way to  
reach your goal.

Brian

On Nov 24, 2009, at 2:39 PM, Steward wrote:

> Hi Brian,
>
> Thanks. I did try that source code but it give me error
> "Fatal error: Call to a member function get_namespace_id() on a non- 
> object in xml2xhtml.php on line 274"
>
> I tested it out using only 3 lines of codes. Did you have the same  
> problem also when using this?
>
> Thanks,
> Steward
>
> ======================================================
> <?php
>
> include 'xml2xhtml.php';
>
> $xmlstring = '<articles><paragraph><link><target>Image:Youth-soccer- 
> indiana.jpg</target><part>thumb</part><part>300px</part><part>right</ 
> part><part>Sport in<space/><link><target>childhood</target></ 
> link>.<space/><link><target>Association football</target></link>,  
> shown above, is a<space/><link><target>team sport</target></ 
> link><space/>which also provides<space/><link><target>social  
> interaction</target></link>.</part></ 
> link><link><target>Image:Showjumping white horse.jpg</ 
> target><part>thumb</part><part>200px</part><part>right</ 
> part><part><link><target>Show Jumping</target></link>, an<space/ 
> ><link><target>Equestrianism</target><part>equestrian</part></ 
> link><space/>sport.</part></link><sentence><bold><link  
> synthetic="true"><target>Sport</target></link></bold><space/>is an  
> activity that is governed by a set of<space/ 
> ><link><target>regulation of sport</target><part>rules</part></ 
> link><space/>or<space/><link><target>tradition</target><part>custom</ 
> part><trail>s</trail></link><space/>and often engaged in<space/ 
> ><link><target>competitively</target></link>.</sentence><space/ 
> ><sentence><italics><link synthetic="true"><target>Sport</ 
> target><part>Sports</part></link></italics><space/>commonly refer to  
> activities where the<space/><link><target>physical capabilities</ 
> target></link><space/>of the competitor are the sole or primary  
> determinant of the outcome (<link><target>victory</ 
> target><part>winning</part></link><space/>or losing), but the term  
> is also used to include activities such as<space/><link><target>mind  
> sports</target></link><space/>(a common name for some<space/ 
> ><link><target>card game</target><trail>s</trail></link><space/ 
> >and<space/><link><target>board game</target><trail>s</trail></ 
> link><space/>with little to no<space/><link><target>luck</ 
> target><part>element of chance</part></link>) and<space/ 
> ><link><target>motor sports</target></link><space/>where<space/ 
> ><link><target>attention</target><part>mental acuity</part></ 
> link><space/>or equipment quality are major factors.</sentence>  
> <sentence><link synthetic="true"><target>Sport</target></link> is  
> commonly defined as an<space/><link><target>organized</target></ 
> link>, competitive and skillful<space/><link><target>physical  
> activity</target></link><space/>requiring commitment and<space/ 
> ><link><target>sportsmanship</target><part>fair play</part></link>.</ 
> sentence> <sentence>Some view sports as differing from games based  
> on the fact that there are usually higher levels of organization  
> and<space/><link><target>Profit (economics)</target><part>profit</ 
> part></link><space/>(not always<space/><link><target>money</ 
> target><part>monetary</part></link>) involved in sports.</sentence>  
> <sentence>Accurate records are kept and updated for most sports at  
> the highest levels, while failures and accomplishments are widely  
> announced in<space/><link><target>sport news</target></link>.</ 
> sentence></paragraph></articles>';
>
> $temp = convert_xml_xhtml($xmlstring);
>
> print $xmlstring;
> ==============================================
>
>
> On Tue, Nov 24, 2009 at 9:32 AM, Brian Karlak <zenkat at metaweb.com>  
> wrote:
>
> On Nov 23, 2009, at 2:06 PM, Steward wrote:
>
>> Thanks for the reply. Is this the MediaWiki rendering engine that  
>> you refer to?
>> http://svn.wikimedia.org/svnroot/mediawiki/trunk/wiki2xml/php/xml2xhtml.php
>>
>> or there are others that I am not aware of the MediaWiki rendering  
>> engine that you specify.
>
> Hi Steward --
>
> I believe that's the main version.  There may be others that I am  
> not aware of.
>
> Brian
>
> _______________________________________________
> Developers mailing list
> Developers at freebase.com
> http://lists.freebase.com/mailman/listinfo/developers
>
>
> <ConvertXML.zip>_______________________________________________
> Developers mailing list
> Developers at freebase.com
> http://lists.freebase.com/mailman/listinfo/developers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freebase.com/pipermail/developers/attachments/20091124/d1e51faa/attachment.htm 


More information about the Developers mailing list