Code Monkey home page Code Monkey logo

omnixml's People

Contributors

gabr42 avatar

Watchers

 avatar  avatar

Forkers

pravinshahi0007

omnixml's Issues

Support for XPath functions

Does omnixml support XPath functions - specifically "contains".  The following 
does not seem to work:

XPath expresstion: //*[contains(@xlink:role,'normal')]/link:loc/@xlink:label

<?xml version="1.0" encoding="UTF-8"?>
<link:linkbase xmlns:link="linking_namespace" xmlns:xlink="xlinking_namespace">
  <link:presentationLink xlink:role="fancy">
    <link:loc xlink:label="part1"/>
    <link:loc xlink:label="part2"/>
    <link:loc xlink:label="part3"/>
  </link:presentationLink>
  <link:presentationLink xlink:role="normal">
    <link:loc xlink:label="part1"/>
    <link:loc xlink:label="part2"/>
    <link:loc xlink:label="part3"/>
  </link:presentationLink>
  <link:presentationLink xlink:role="funny">
    <link:loc xlink:label="part1"/>
    <link:loc xlink:label="part2"/>
    <link:loc xlink:label="part3"/>
  </link:presentationLink>
</link:linkbase>

I am using the code from the XPath demo supplied - am I doing something wrong?

Original issue reported on code.google.com by [email protected] on 25 Jul 2013 at 10:10

Support for XPath functions

Does omnixml support XPath functions - specifically "contains".  The following 
does not seem to work:

XPath expresstion: //*[contains(@xlink:role,'normal')]/link:loc/@xlink:label

<?xml version="1.0" encoding="UTF-8"?>
<link:linkbase xmlns:link="linking_namespace" xmlns:xlink="xlinking_namespace">
  <link:presentationLink xlink:role="fancy">
    <link:loc xlink:label="part1"/>
    <link:loc xlink:label="part2"/>
    <link:loc xlink:label="part3"/>
  </link:presentationLink>
  <link:presentationLink xlink:role="normal">
    <link:loc xlink:label="part1"/>
    <link:loc xlink:label="part2"/>
    <link:loc xlink:label="part3"/>
  </link:presentationLink>
  <link:presentationLink xlink:role="funny">
    <link:loc xlink:label="part1"/>
    <link:loc xlink:label="part2"/>
    <link:loc xlink:label="part3"/>
  </link:presentationLink>
</link:linkbase>

I am using the code from the XPath demo supplied - am I doing something wrong?

Original issue reported on code.google.com by [email protected] on 25 Jul 2013 at 10:03

Unicode and Delphi2010

function DecimalSeparator: char;
begin
  {$IFDEF Unicode}
  Result := FormatSettings.DecimalSeparator;
  {$ELSE}
  Result := SysUtils.DecimalSeparator;
  {$ENDIF Unicode}
end; { DecimalSeparator }


This exists in Delphi XE up, not in Delphi 2010 with Unicode

FormatSettings.DecimalSeparator;

Original issue reported on code.google.com by [email protected] on 13 Sep 2012 at 9:18

Close brackets and CDATA nodes

Hello,

First of all thanks very much for omnixml, no doubt a very good way to deal 
with XML from Delphi. I found a problem when retrieve some Javascript code from 
a CDATA node.

If we save in a CDATA node something like the below Javascript line:

foo([['Hello', 'Brackets']]);

The Javascript code is saved OK, but, when we use the "GetNodeCData" function 
from the "OmniXMLUtils" unit the result of such function is this:

foo([['Hello', 'Brackets');

** Note how the two end brackets are removed by "GetNodeCData" function.

I am using the latest OmniXML version which is available when I write this 
issue, installed in Delphi XE2 and running Microsoft Windows 8.1.

Can anybody help me in some manner?

Thanks in advance and thanks for OmniXML.

Original issue reported on code.google.com by [email protected] on 1 Jul 2015 at 10:39

ChildNode not found but it exists

What steps will reproduce the problem?
1. var n:IXMLNode; 
2. n.ParentNode.ChildNodes.IndexOf(n)=-1
3.

What is the expected output? What do you see instead?

n.ParentNode.ChildNodes.IndexOf(n)<>-1

What version of the product are you using? On what operating system?
product OMNIXML.pas  r22 by mremec on Mar 27, 2014 

Please provide any additional information below.

To correct the error all typecasts of IXMLNode to Pointer must be changed
by typecasts IXMLNode as IUnknown to Pointer as shown below:

function TXMLCustomList.Add(const XMLNode:IXMLNode):integer;
begin
  Result:=FList.Add(pointer(XMLNode as IUnknown));
  XMLNode._AddRef;
end;

Original issue reported on code.google.com by [email protected] on 18 Nov 2014 at 8:29

XPath predicates - cannot contain forward slashes?

For the attached XML, the XPath expression with the following predicate works:
  //link:presentationLink[@xlink:role="funny"]

However, if the predicate contains a string with forward slashes, a syntax 
error occurs:
//link:presentationLink[@xlink:role="www.google.com/testing]

Is there any chance that this might get fixed?

<?xml version="1.0" encoding="UTF-8"?>
<link:linkbase xmlns:link="linking_namespace" xmlns:xlink="xlinking_namespace">
  <link:presentationLink xlink:role="fancy">
    <link:loc xlink:label="part1"/>
    <link:loc xlink:label="part2"/>
    <link:loc xlink:label="part3"/>
  </link:presentationLink>
  <link:presentationLink xlink:role="www.google.com/testing">
    <link:loc xlink:label="part1"/>
    <link:loc xlink:label="part2"/>
    <link:loc xlink:label="part3"/>
  </link:presentationLink>
  <link:presentationLink xlink:role="funny">
    <link:loc xlink:label="part1"/>
    <link:loc xlink:label="part2"/>
    <link:loc xlink:label="part3"/>
  </link:presentationLink>
</link:linkbase>

Original issue reported on code.google.com by [email protected] on 25 Jul 2013 at 10:09

Confusion: Unexpectedly XPath seach starts at wrong element

Further elaborating at http://code.google.com/p/omnixml/issues/detail?id=9

~~~~~~ Node ~~~~~
  <hasp id="1299527092" type="HASP-HL">
    <feature id="0" />
    <feature id="16" />
    <vendor id="54321"/>
    <license_manager >
      <ip>127.0.0.1</ip>
      <osname>Windows 7 Professional</osname>
    </license_manager>
  </hasp>

I try to extract values using expressions like
"hasp/license_manager/ip"
"hasp/vendor/@id"
"hasp/@id"

Correct results returned by

  1. http://www.freeformatter.com/xpath-tester.html
  2. http://xpath.online-toolz.com/tools/xpath-editor.php
  3. http://www.softpedia.com/get/Programming/File-Editors/XMLPad.shtml

No matches returned by OmniXML XPathSelect

However the broken expressions
"license_manager/ip"
"vendor/@id"
"@id"

Extract correct results in OmniXML and no results in reference tools

From the hindsight, the reference tools (that are normally used to debug and
settle the expressions), so they kind add invisible virtual "document-root)
node on top of it. While OmniXML works inside the node with the document.
But that is very confusing and unexpected.

I'd propose to add
XPathSelect(NodeList, expression) overload
and
XPathSelect(Node, expression, TreatAsDocument: boolean = false)
or XPathSelectAsDoc(Node, expression)

To make transplanting expressions from editors/debuggers into sources easier


Original issue reported on code.google.com by `[email protected]` on 10 Dec 2014 at 2:51

Unicode Delphi breaks XPath demo

Compile XPath Demo in XE2 and run it

All the tests would get "failed" status and show garbage instead of required 
etalon results

Reason: desired results are kept in TList as PAnsiChar but are read from it as 
PUnicodeString

fix: TfrmXPathDemo.FXPathResults    : TStringList; -> and all the direct 
consequnces

Original issue reported on code.google.com by [email protected] on 9 Dec 2014 at 5:29

XPath: breaks on multiple predicates ( returns empty nodelist)

Expression: "//hasp[@id][feature[@id != 0]]"

XML:

<hasp_info>



<license_manager >
127.0.0.1
Windows 7 Professional
</license_manager>




<license_manager >
192.168.7.235
Windows 7 Professional
</license_manager>



<license_manager>
192.168.7.169
Windows 7 Professional
</license_manager>

</hasp_info>


Correct results returned by

 1. http://www.freeformatter.com/xpath-tester.html
 2. http://xpath.online-toolz.com/tools/xpath-editor.php
 3. http://www.softpedia.com/get/Programming/File-Editors/XMLPad.shtml

Original issue reported on code.google.com by [email protected] on 9 Dec 2014 at 5:33

Duplicate headers when loading XML file with UTF8 headers

What steps will reproduce the problem?
1. Load sample XML file with <?xml ... ?> header (see below)
2. Save file back to disk

What is the expected output? What do you see instead?
I expected to see a single header line, but after loading the document from 
disk an additional header line is added (and subsequently written back to disk).

What version of the product are you using? On what operating system?
v1.16 (2013-07-01) on Delphi XE2 / Win 7 x64

Please provide any additional information below.

Sample file:
data.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<system>
  <items>
    <item/>
  </items>
</system>

var
  gDoc :  IXMLDocument;
begin
  gDoc := CreateXMLDoc;
  gDoc.Load('data.xml');

gDoc.XML now contains:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<system>
  <items>
    <item/>
  </items>
</system>

Original issue reported on code.google.com by [email protected] on 1 Oct 2013 at 10:08

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.