Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7140 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hello,

Here is the xml that i am pulling into my database:

  

[color:"red"](?xml version="1.0" encoding="UTF-8" ?) 

- (gesmes:Envelope xmlns:gesmes="http://www.gesmes.org/xml/2002-08-01" xmlns=http://www.ecb.int/vocabulary/2002-08-01/eurofxref)

 (gesmes:subject>Reference rates(/gesmes:subject) 

- (gesmes:Sender)

  (gesmes:name)European Central Bank(/gesmes:name) 

  (/gesmes:Sender)



- (Cube)

- (Cube time="2005-04-21")

  (Cube currency="USD" rate="1.3058" /) 

  (Cube currency="JPY" rate="140.27" /) 

  (Cube currency="CYP" rate="0.5822" /) 

  (Cube currency="CZK" rate="30.196" /) 

  (Cube currency="DKK" rate="7.4494" /) 

  (Cube currency="EEK" rate="15.6466" /) 

  (Cube currency="GBP" rate="0.68475" /) 

  (Cube currency="HUF" rate="248.20" /) 

  (/Cube)



  (/Cube)



  (/gesmes:Envelope)[/color] )

My problem is I can not get any data from the cube fields. I have no problem getting from the normail fields like (gesmes:name) because it has an opening and closing tag. I really need to get the info in the (Cube currency fields for rate conversion in my database. If anyone can help I would greatly appreciate it.

Posted

I am not using a style sheet. I use a url plugin from troi.com. I currently use it to get address, and rate information from usps and fedex.

All I have to do is get the page and pull things out of it that I want. But I am having trouble pulling the data out of the (Cube currency) fields because they do not have an opening and closing tag.

My scripts and fields are set up to where I can just pull a specific element out, like "gemes:name" by just typing "gemes:name" as a search criteria. But I can not search for "cube currency" because It is not enclosed in individual opening and closing tags. I need to get this information out in order to do currency exchange for my database.

Posted

Sorry, I don't know anything about the Troi plugin. But maybe it will help you to know that in an XSLT, you would refer to the "gesmes:name" element as

gesmes:Envelopegesmes:Sendergesmes:name

But because each Cube element has no data (you can see this by its lack of a closing tag), only attributes, you cannot get any data from

gesmes:EnvelopeCubeCube

Rather, you refer to its attributes like so:

gesmes:EnvelopeCubeCube@currency

gesmes:EnvelopeCubeCube@rate

Maybe try searching for Cube@currency instead of "cube currency"?

J

  • 2 weeks later...
Posted

You don't specify *how* you are using scripts and (calculated?) fields to grab the "element" data. You can use the FILEMAKER functions, such as PatternCount(), Left(), RightWords(), Position(), etc. to grab things.

Try to get the Position() of the quotes to extract the Middle() of the text. Also, can you post some of your methods?

Posted

If Beverly is still there. If one was going to do this with XSL, I ran into a small problem. Basically there was something about the way they had the namespace in the root element, but not in the Cube elements which caused errors (for me). I was not able to access the Cube elements as they were. I had to prefix them with the root namespace, in the xml (which wouldn't work in real life, 'cause you wouldn't have access to it. The below worked:

xml code:

<gesmes:Cubes>

<gesmes:Cube time="2005-04-21">

<gesmes:Cube currency="USD" rate="1.3058" />

xsl code:

<xsl:for-each select="gesmes:Cubes">

<xsl:value-of select="gesmes:Cube/@time" />

<xsl:for-each select="gesmes:Cube/gesmes:Cube">

I was not able to get a result for Cube elements unless I did this. There must be another way. Namespaces are a bit of a mystery.

Posted

Simply adjust the import order to "matching names" and it will work properly again (save the new/altered curreny symbols).

--

(**) As of 1 January 2005 the currency of the Republic of Turkey is the new Turkish lira (TRY). 1 TRY equals 1,000,000 Turkish liras (TRL).

This topic is 7140 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.