Search Results

Search found 113 results on 5 pages for 'libxml'.

Page 1/5 | 1 2 3 4 5  | Next Page >

  • How to upgrade libxml on CentOS

    - by Radek Simko
    I have a following version of CentOS: $ cat /etc/issue CentOS release 5.5 (Final) Kernel \r on an \m and following version of libxml: $ php -i | grep libxml libxml Version => 2.6.26 libxml libxml2 Version => 2.6.26 libxslt compiled against libxml Version => 2.6.26 and need to have newer version of libxml (primarly for usage in PHP, but obviously, it doesn't matter). If I even install the newer version of libxml somehow: wget ftp://xmlsoft.org/libxml2/libxml2-2.7.2.tar.gz tar -xvf libxml2-2.7.2.tar.gz cd libxml2-2.7.2 ./configure make sudo make install then I am unable to get it to work in PHP - there is still old version: libxml Version => 2.6.26 libxml libxml2 Version => 2.6.26 libxslt compiled against libxml Version => 2.6.26 What else do I need to do to make the new version to work with PHP?

    Read the article

  • XML::LibXML Line Ending (whitespace) Problem.

    - by Gilbeg
    HI, I am parsing an XML file using LibXML in Perl. The problem that I have is the ending characters (whitespace) is treated as a text node. For instance, given an input like the following abc 123 The parser thinks that the number of child of node "books" is 3, they are: - text node (containing the char between and - element node of "book" - text node (containing the char between and Question is how do I tell LibXML to ignore whitespaces? I tried with no_blanks (that is $parser = XML::LibXML-new(no_blanks = 1) when construction the parser) but it seems that it has no effect. Thanks in advance

    Read the article

  • Perl, LibXML and Schemas

    - by Xetius
    I have an example Perl script which I am trying to load and validate a file against a schema, them interrogate various nodes. #!/usr/bin/env perl use strict; use warnings; use XML::LibXML; my $filename = 'source.xml'; my $xml_schema = XML::LibXML::Schema->new(location=>'library.xsd'); my $parser = XML::LibXML->new (); my $doc = $parser->parse_file ($filename); eval { $xml_schema->validate ($doc); }; if ($@) { print "File failed validation: $@" if $@; } eval { print "Here\n"; foreach my $book ($doc->findnodes('/library/book')) { my $title = $book->findnodes('./title'); print $title->to_literal(), "\n"; } }; if ($@) { print "Problem parsing data : $@\n"; } Unfortunately, although it is validating the XML file fine, it is not finding any $book items and therefore not printing out anything. If I remove the schema from the XML file and the validation from the PL file then it works fine. I am using the default namespace. If I change it to not use the default namespace (xmlns:lib="http://libs.domain.com" and prefix all items in the XML file with lib and change the XPath expressions to include the namespace prefix (/lib:library/lib:book) then it again works file. Why? and what am I missing? XML: <?xml version="1.0" encoding="utf-8"?> <library xmlns="http://lib.domain.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://lib.domain.com .\library.xsd"> <book> <title>Perl Best Practices</title> <author>Damian Conway</author> <isbn>0596001738</isbn> <pages>542</pages> <image src="http://www.oreilly.com/catalog/covers/perlbp.s.gif" width="145" height="190"/> </book> <book> <title>Perl Cookbook, Second Edition</title> <author>Tom Christiansen</author> <author>Nathan Torkington</author> <isbn>0596003137</isbn> <pages>964</pages> <image src="http://www.oreilly.com/catalog/covers/perlckbk2.s.gif" width="145" height="190"/> </book> <book> <title>Guitar for Dummies</title> <author>Mark Phillips</author> <author>John Chappell</author> <isbn>076455106X</isbn> <pages>392</pages> <image src="http://media.wiley.com/product_data/coverImage/6X/07645510/076455106X.jpg" width="100" height="125"/> </book> </library> XSD: <?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns="http://lib.domain.com" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://lib.domain.com"> <xs:attributeGroup name="imagegroup"> <xs:attribute name="src" type="xs:string"/> <xs:attribute name="width" type="xs:integer"/> <xs:attribute name="height" type="xs:integer"/> </xs:attributeGroup> <xs:element name="library"> <xs:complexType> <xs:sequence> <xs:element maxOccurs="unbounded" name="book"> <xs:complexType> <xs:sequence> <xs:element name="title" type="xs:string"/> <xs:element maxOccurs="unbounded" name="author" type="xs:string"/> <xs:element name="isbn" type="xs:string"/> <xs:element name="pages" type="xs:integer"/> <xs:element name="image"> <xs:complexType> <xs:attributeGroup ref="imagegroup"/> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>

    Read the article

  • Why can't I access elements inside an XML file with XPath in XML::LibXML?

    - by John
    I have an XML file, part of which looks like this: <wave waveID="1"> <well wellID="1" wellName="A1"> <oneDataSet> <rawData>0.1123975676</rawData> </oneDataSet> </well> ... more wellID's and rawData continues here... I am trying to parse the file with Perl's libXML and output the wellName and the rawData using the following: use XML::LibXML; my $parser = XML::LibXML->new(); my $doc = $parser->parse_file('/Users/johncumbers/Temp/1_12-18-09-111823.orig.xml'); my $xc = XML::LibXML::XPathContext->new( $doc->documentElement() ); $xc->registerNs('ns', 'http://moleculardevices.com/microplateML'); my @n = $xc->findnodes('//ns:wave[@waveID="1"]'); #xc is xpathContent # should find a tree from the node representing everything beneath the waveID 1 foreach $nod (@n) { my @c = $nod->findnodes('//rawData'); #element inside the tree. print @c; } It is not printing out anything right now and I think I have a problem with my Xpath statements. Please can you help me fix it, or can you show me how to trouble shoot the xpath statements? Thanks.

    Read the article

  • How to config PHP libxml path after updated libxml from 2.2.26 to 2.9

    - by Cauliturtle
    our servers need to update the libxml2 version from 2.2.26 to 2.9 (latest version). It is no problem that we have been installed the libxml2-2.9 version on our servers. but the problem is how can we config the libs path of libxml2 path in php? Since it still show the old version on phpinfo(). What we have do is 1. Install libxml2 2.7.X on CentOS 5.X Using yum to install local files, and typed yum info libxml2, it shows 2.9 was installed. Thanks!

    Read the article

  • Is there a reason to use the XML::LibXML::Number-object in my XML::LibXML-example?

    - by sid_com
    In this example I get to times '96'. Is there a possible case where I would need a XML::LibXML-Number-object to to achieve the goal? #!/usr/bin/env perl use warnings; use strict; use 5.012; use XML::LibXML; my $xml_string =<<EOF; <?xml version="1.0" encoding="UTF-8"?> <filesystem> <path> <dirname>/var</dirname> <files> <action>delete</action> <age units="hours">10</age> </files> <files> <action>delete</action> <age units="hours">96</age> </files> </path> </filesystem> EOF #/ my $doc = XML::LibXML->load_xml( string => $xml_string ); my $root = $doc->documentElement; my $result = $root->find( '//files/age[@units="hours"]' ); $result = $result->get_node( 1 ); say ref $result; # XML::LibXML::Element say $result->textContent; # 96 $result = $root->find ( 'number( //files/age[@units="hours"] )' ); say ref $result; # XML::LibXML::Number say $result; # 96

    Read the article

  • xsl:include fails after upgrading PHP version; is libxml/libxslt version mismatch the issue?

    - by Wiseguy
    I'm running Windows XP with the precompiled PHP binaries available from windows.php.net. I upgraded from PHP 5.2.5 to PHP 5.2.16, and now the xsl:includes in some of my stylesheets stopped working. Testing each version in succession, I discovered that it worked up through 5.2.8 and does not work in 5.2.9+. I now get the following three errors for each xsl:include. Warning: XSLTProcessor::importStylesheet() [xsltprocessor.importstylesheet]: I/O warning : failed to load external entity "file%3A/C%3A/path/to/included/stylesheet.xsl" in ... on line 227 Warning: XSLTProcessor::importStylesheet() [xsltprocessor.importstylesheet]: compilation error: file file%3A//C%3A/path/to/included/stylesheet.xsl line 36 element include in ... on line 227 Warning: XSLTProcessor::importStylesheet() [xsltprocessor.importstylesheet]: xsl:include : unable to load file%3A/C%3A/path/to/included/stylesheet.xsl in ... on line 227 I presume this is because it cannot find the specified file. Many of the includes are in the same directory as the stylesheet being transformed and have no directory in the path, i.e. <xsl:include href="fileInSameDir.xsl">. Interestingly, in the first and third errors, it is displaying the file:// protocol with only one slash instead of the correct two. I'm guessing that's the problem. (When I hard-code a full path using "file:/" it fails, but when I hard-code a full path with "file://" it works.) But what could cause that? A bug in libxslt/libxml? I also found an apparent version mismatch between libxml and the version of libxml that libxslt was compiled against. 5.2.5 libxml Version = 2.6.26 libxslt compiled against libxml Version = 2.6.26 5.2.8 libxml Version = 2.6.32 libxslt compiled against libxml Version = 2.6.32 === it breaks in versions starting at 5.2.9 === 5.2.9 libxml Version = 2.7.3 libxslt compiled against libxml Version = 2.6.32 5.2.16 libxml Version = 2.7.7 libxslt compiled against libxml Version = 2.6.32 Up until PHP 5.2.9, libxslt was compiled against the same version of libxml that was included with PHP. But starting with PHP 5.2.9, libxslt was compiled against an older version of libxml than that which was included with PHP. Is this a problem with the distributed binaries or just a coincidence? To test this, I imagine PHP could be built with different versions of libxml/libxslt to see which combinations work or don't. Unfortunately, I'm out of my element in a Windows world, and building PHP on Windows seems over my head. Regrettably, I've been thus far unable to reproduce this problem with an example outside my app, so I'm struggling to narrow it down and can't submit a specific bug. So, do you think it is caused by a version mismatch problem in the distributed binaries? a bug introduced in PHP 5.2.9? a bug introduced in libxml 2.7? something else? I'm stumped. Any thoughts that could point me in the right direction are greatly appreciated. Thanks.

    Read the article

  • html parsing with libxml

    - by zajcev
    In another thread I got convinced into using HTML parsers instead of regexps for HTML parsing (I thought they would work fine, but they didn't ;) ). I thought of using libxml (it has some HTML parser built in), but failed to find any useful tutorial. I also found this site and it says here it should do fine even with severly broken HTML. Could you give me some examples of HTML parsing with libxml, or maybe recommend some different free library for Linux? I'm using C++. I just thought someone would have some example code, so that I don't have to analyze the headers ;)

    Read the article

  • Cannot install XML::LibXML module on Windows

    - by Deepak Konidena
    I am trying to use XPath to extract some HTML tags and data and for that I need to use XML::LibXML module. I tried installing it from CPAN shell but it doesn't install. I followed the instructions from CPAN site about the installation, that we need to install libxml2, iconv and zlib wrappers before installing XML::LibXML and it didn't work out. Also, if there is any other simpler module that gets my task done, please let me know. The task at hand: I am searching for a specific <dd> tag on a html page which is really big ( around 5000 - 10000) <dd> and <dt> tags. So, I am writing a script which matches the content within <dd> tag and fetches the content within the corresponding (next) <dt> tag. I wish i could i have been a little more clearer. Any help is greatly appreciated.

    Read the article

  • Installing libcurl and libxml for PHP on windows

    - by mauro.dec
    Hello! Ive done a fair ammount of googling but didnt find any answers yet so I decided to ask here. I need to do some programming with PHP and Google Checkout. I need to install libcurl and libxml on a server running WAMP, but being a Linux user myself I have no idea how to install these libs. Has anyone here done this before? Thanks in advance.

    Read the article

  • XML::LibXML::XPathContext - Question

    - by sid_com
    This script works with and without XPathContext. Why should I use it with XPathContext? #!/usr/bin/env perl use warnings; use strict; use XML::LibXML; use 5.012; my $parser = XML::LibXML->new; my $doc = $parser->parse_string(<<EOT); <?xml version="1.0"?> <xml> Text im Dokument <element id="myID" name="myname" style="old" /> <object objid="001" objname="Object1" /> <element id="002" name="myname" /> </xml> EOT #/ # without XPathContext my $nodes = $doc->findnodes( '/xml/element[@id=002]' ); # with XPathContext #my $root = $doc->documentElement; #my $xc = XML::LibXML::XPathContext->new( $root ); #my $nodes = $xc->findnodes( '/xml/element[@id=002]' ); for my $node ( $nodes->get_nodelist ) { say "Node: ", $node->nodeName; print "Attribute: "; print $_->getName, '=', $_->getValue, ' ' for $node->attributes; say ""; }

    Read the article

  • Facing Problem with Libxml.rb

    - by Rakesh
    Hi Folks, I downloaded one of the rails app from server and tried running it.I faced an error on migration D:\Radiant\trunkrake db:migrate (in D:/Radiant/trunk) rake aborted! 126: The specified module could not be found. - D:/Radiant/trunk/config/../ven dor/plugins/libxml-ruby/lib/libxml_ruby.so I got the windows version of libxml_ruby.so and tried again. i got the error saying " libxml2.dll " not found.Then i checked the file libxml.rb ..it says the below lines . If running on Windows, then add the current directory to the PATH for the current process so it can find the pre-built libxml2 and iconv2 shared libraries (dlls). Can anybody explain me what actually this mean? Regards Rakesh S

    Read the article

  • Parsing SOAP response using libxml in Ruby

    - by abhishektiwari
    I am trying to parse following SOAP response coming from Savon SOAP api <?xml version='1.0' encoding='UTF-8'?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <ns:getConnectionResponse xmlns:ns="http://webservice.jchem.chemaxon"> <ns:return> &lt;ConnectionHandlerId>connectionHandlerID-283854719&lt;/ConnectionHandlerId> </ns:return> </ns:getConnectionResponse> </soapenv:Body> </soapenv:Envelope> I am trying to use libxml-ruby without any success. Basically I want to extract anything inside tag and the connectionHandlerID value.

    Read the article

  • Why do I get this error trying to compile libxml2?

    - by bfaskiplar
    Although, I installed libxml2 once and reinstalled it for a few times. I cannot compile c-source code because compiler cannot find where the header file is. I am able to locate where it is (in the folder where I downloaded the tar.gz package) but I had a feeling in my guts that this package isn't installed correctly because when I tried to sudo make install, it says /bin/bash: /home/bfaskiplar/Downloads/tar.gz: No such file or directory make[2]: *** [install-libLTLIBRARIES] Error 127 make[2]: Leaving directory `/home/bfaskiplar/Downloads/tar.gz packages/libxml2-2.8.0' make[1]: *** [install-am] Error 2 make[1]: Leaving directory `/home/bfaskiplar/Downloads/tar.gz packages/libxml2-2.8.0' make: *** [install-recursive] Error 1 that's why I installed synaptic package manager and reinstalled it, but in this case, isn't it supposed to put header files in default directory where gcc normally searches in currently, I am able to compile it with -I option, but I wonder why do I have to copy headers manually even if I used synaptic for installation and why I am getting Error 1 and Error 2 when trying to install the package manually. thanks in advance

    Read the article

  • creating xml element with two namespaces using libxml APIs

    - by iSight
    Hi, I want to create an xml element having two namespace as below: element name="Root" xmlns:xsi="myXSI" xmlns:xsd="myXSD" I have checked out with the existing APIs, but it is not getting in this form. I am getting as Root xmlns:xsd:xsi="myXSI" xmlns:xmlns:xsd="myXSD" I am using this APIss as below: xmlTextWriterWriteAttributeNS(xmlWriter, BAD_CAST "xmlns:xsd", BAD_CAST "xsi" , BAD_CAST "myXSD", BAD_CAST "myXSI");

    Read the article

  • getting attributes of href using libxml

    - by iSight
    Hi, I have xml file nameed Hello as under with starting node as under: /Hello xmlns:xsi: = "some text" xmlns:xsd = "some text" version="1.0"/ I tried to get the first and second attributes of node named Hello, using xmlAttr *attr = nodePtr-properties;//nurrent node is Hello while ( attr ) { NSLog(@"\n Attribute name:%s value:%s",attr->name,attr->children->content); attr = attr->next; }; But, i could not get the first and second attributes, instead it only returns third attribute. How can i get the first and second attributes

    Read the article

  • Is this a valid XPath expression?

    - by sid_com
    Is this xpath a valid XPath expression? (It does what it should ). #!/usr/bin/env perl use strict; use warnings; use 5.012; use XML::LibXML; my $string =<<EOS; <result> <cd> <artists> <artist class="1">Pumkinsingers</artist> <artist class="2">Max and Moritz</artist> </artists> <title>Hello, Hello</title> </cd> <cd> <artists> <artist class="3">Green Trees</artist> <artist class="4">The Leons</artist> </artists> <title>The Shield</title> </cd> </result> EOS #/ my $parser = XML::LibXML->new(); my $doc = $parser->load_xml( string => $string ); my $root = $doc->documentElement; my $xpath = '/result/cd[artists[artist[@class="2"]]]/title'; my @nodes = $root->findnodes( $xpath ); for my $node ( @nodes ) { say $node->textContent; }

    Read the article

  • XML::LibXML: How to write a xpath with qualified name?

    - by sid_com
    I've found this on http://www.perlmonks.org/?node_id=606909 looking by qualified name ... In this case you can call findnodes method on any node, you don't need the XML::LibXML::XPathContext with its prefix = namespace mapping: $doc-findnodes('///info/fooTransaction/transactionDetail/[name() = "histFile:transactionSummary"]/*'); In which way I have to edit my xpath to get my script working without XPathContext? #!/usr/bin/env perl use warnings; use strict; use 5.012; use XML::LibXML; my $parser = XML::LibXML->new; $parser->recover_silently( 1 ); my $doc = $parser->parse_file( 'http://www.heise.de/' ); my $xc = XML::LibXML::XPathContext->new( $doc->getDocumentElement ); $xc->registerNs( 'xmlns', 'http://www.w3.org/1999/xhtml' ); my $nodes = $xc->findnodes( '//xmlns:h2/xmlns:a' ); for my $node ( $nodes->get_nodelist ) { say $_->getName, '=', $_->getValue for $node->attributes; }

    Read the article

  • How to access xmlParserCtxt structure from within xmlSAXHandler callbacks?

    - by Lux In Tenebris
    I'm parsing (X)HTML pages content with libxml using the following call: htmlDocPtr doc = htmlSAXParseDoc(content, NULL, &html_handler, NULL); But for debugging purposes I need to analyze some of the current node properties in the start/end element callbacks. I know that the fourth argument of htmlSAXParseDoc can be used to pass any user defined data to the callbacks, but I don't have a pointer to xmlParserCtxt.

    Read the article

  • PHP and XSLTProcessor Misbehavior

    - by Aiden Bell
    Hi all, Simple question: Why is a PHP function called from an XSL Stylesheet just returning the last argument passed: foo.xsl: <xsl:template match="/"> <xsl:value-of select="php:function('date','c')" /> </xsl:template> PHP: ... $xsl = new XSLTProcessor(); $xsl->registerPHPFunctions(); $xsl->importStylesheet($fooStylesheet); echo $xsl->transformToXML($myXML); I Get the output c and if I call <xsl:value-of select="php:function('date')" /> I just get date as my output. Seems strange to me. Version info: PHP 5.3.2 libxslt Version 1.1.26 libxslt compiled against libxml Version 2.7.6 EXSLT enabled libexslt Version 1.1.26

    Read the article

  • Getting exception when coming back while loading data in controller while using LibXml.

    - by user133611
    Hi All, In my project i using LibXml to parse data, when i select a row in first controller i will take to next conttroller where i will get data using libxml if i click on the back button while loading the page i am getting exception. if i click afetr loading is completed it is working fine ca any one help me. the exception is showing here (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { // Process the downloaded chunk of data. xmlParseChunk(_xmlParserContext, (const char *)[data bytes], [data length], 0); } Thank You

    Read the article

  • How to ignore CDATA tags?

    - by Petre
    I'm trying to make an html parser, but when I load the html I get warnings like this Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: Invalid char in CDATA 0x1C in Entity, line: 1302 Here is the code I use class Parser { public $url=null; public $html=null; public $tidy=null; public $head=null; public $head_xpath=null; function __construct($url){ $this->url=$url; $this->html=file_get_contents($this->url); $this->tidy=tidy_parse_string($this->html); $this->head=new DOMDocument(); $this->head->loadHTML($this->tidy->head()); $this->head_xpath= new DOMXPath($this->head); } } $x=new Parser("http://www.guardian.co.uk/politics/2012/mar/24/vince-cable-coalition-banking-row"); I searched around and found the LIBXML_NOCDATA constant, but I don't know how to set it. So how could i completely ignore CDATA?

    Read the article

  • How to solve Memory leaks in Lib Xml Parser in objective-C where the list is returned?

    - by Madan Mohan
    Hi Guys, I got leaks in Lib Xml Parser while retrieving the data from the net, Here in the below code, I have allocated the list - (void)getCustomersList { // make an operation so we can push it into the queue SEL method = @selector(parseForData); NSInvocationOperation *op = [[NSInvocationOperation alloc] initWithTarget:self selector:method object:nil]; customersTempList = [[NSMutableArray alloc] initWithCapacity:20];// allocated list [self.retrieverQueue addOperation:op]; [op release]; } // return each recode // in parser .m class one of the condition in endElement where it shows a leak. else if(0 == strncmp((const char *)localname, kCustomerElement, kCustomerElementLength)) { [customersTempList addObject:customer]; printf("\n no of objects in temp list:%d", [customersTempList count]); if ([customersTempList count] == 20) { NSMutableArray* argsList = [customersTempList copy];//////////////////////here it is showing leak. printf("\n Calling reload data with %d new objects", [argsList count]); SEL selector = @selector(parser:addCustomerObject:); NSMethodSignature *sig = [(id)self.delegate methodSignatureForSelector:selector]; if(nil != sig && [self.delegate respondsToSelector:selector]) { NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:sig]; [invocation retainArguments]; [invocation setTarget:self.delegate]; [invocation setSelector:selector]; [invocation setArgument:&self atIndex:2]; [invocation setArgument:&argsList atIndex:3]; [invocation performSelectorOnMainThread:@selector(invoke) withObject:NULL waitUntilDone:NO]; } [customersTempList removeAllObjects]; } } // returned the list after all the records are stored in the list else if(0 == strncmp((const char *)localname, kCustomersElement, kCustomersElementLength)) { printf("\n Calling reload data with %d new objects", [customersTempList count]); NSMutableArray* argsList = [customersTempList copy]; printf("\n Calling reload data with %d new objects", [argsList count]); SEL selector = @selector(parser:addCustomerObject:); NSMethodSignature *sig = [(id)self.delegate methodSignatureForSelector:selector]; if(nil != sig && [self.delegate respondsToSelector:selector]) { NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:sig]; [invocation retainArguments]; [invocation setTarget:self.delegate]; [invocation setSelector:selector]; [invocation setArgument:&self atIndex:2]; [invocation setArgument:&argsList atIndex:3]; [invocation performSelectorOnMainThread:@selector(invoke) withObject:NULL waitUntilDone:NO]; } [customersTempList removeAllObjects]; } } please help me out of this, Thanks, Madan.

    Read the article

1 2 3 4 5  | Next Page >