Where to Use xml_decode?
Options
![Brandon Hassler](https://us.v-cdn.net/6037124/user_avatars/4585463.jpg)
Brandon Hassler
Member ✭
I've got an API that returns the results in one big chunk of XML data:[image.png]
Based on other things I've seen here, it seems that parsing this out into data I can work with is possible via the xml_decode filter, but I'm not sure where to apply it?
I tried applying the filter on the text headers of the API call but then it wouldn't fire correctly, and then I also tried applying the filter on the created varible that isolates that result section:[image.png]Still no luck and can't seem to find any strong documentation on this. Any help would be appreciated!
Based on other things I've seen here, it seems that parsing this out into data I can work with is possible via the xml_decode filter, but I'm not sure where to apply it?
I tried applying the filter on the text headers of the API call but then it wouldn't fire correctly, and then I also tried applying the filter on the created varible that isolates that result section:[image.png]Still no luck and can't seem to find any strong documentation on this. Any help would be appreciated!
Comments
-
What results do you get from the xml_decode filter? Can you share a screenshot?
-
As you can see, I just get a "Error parsing XML." message[image.png]
-
I think you might need to jam in an xml header before the text before decoding. A previous successful xano user has that at tue start. The concat filter should help enable that. -
I am however afk so I’m glad to take a look when I am back for a more considered reply.) -
Appreciate it! Is this different than the XML header I currently have using their cURL data?
From them:[image.png]My setup:[image.png] -
yes. The article does a better job than me tapping out my phone but the short version is that I think you want to jam a line that starts with -
and of course circle ate my pseudo code because it contained a less than sign which it confused with html. Oof. -
Ha! No worries! You are saying slide this line of text into the API results:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>Am I wanting to jam this in at the very top of the API response, or at the top of that "result" section that is giving me actual items?
I'll start with the first and see how that goes 😀 -
I meant make another create variable that is the concatenated string starting with the header - plus a newline- and then the body you got. Look at that to make sure you like it (I would use stop and debug for this introspection) and then make another variable that applies the xml decode filter to that string. -
Just to make sure I understand, here is the layout of this call: [image.png]Are you saying that the goal is sandwhich the custom XML line between the "headers" section and the "result" section?
-
Hi! Back at my desk.
I did a quick test where I tried passing "headless" XML into the parser and... it worked! So the headlessness isn't necessarily a problem. Makes me think there's something else in the detail of the result. Here's a site where you could pass the "result" and "parse" the string to make sure it looks copacetic: https://jsonformatter.org/xml-parser.
And if you can share the XML I could help more. Here's a codeshare where you could paste if you wanted to let me take a look: https://codeshare.io/JbJ1qR -
If by "result" you mean the whole shabang that is returned to me, I just dropped that in the codeshare link!
When I test an API call using Rakuten's API builder, it's formated great, but then when that same call gets dumped into Xano, something happens where it crams it all together.[image.png]
If you want to generate your own call from the source to test, you can do so by going here. Here's a temporary token that you can enter via the little lock icon on the top-right side of the "Product Search" API:
A4QZNVbOjm7VIxmiCeS074cx0nOJmqeg
Just do a tech related search like "gaming monitors" and for the Advertiser ID use 44583. -
This is so weird. Feels almost like a Xano glitch. maybe this is a possibility. No matter how I try it, I cannot get Xano to decode the following XML:
104953144583Newegg196052773642021-12-16/10:16:449SIA575DT91489AOC AGON AG271UG 27' Gaming Monitor, G-SYNC, 4k/ UHD (3840x2160), IPS Panel, 60Hz, 4ms, Height Adjustable, DisplayPort, HDMI, USBElectronicsVideo~~Computer Monitors2663.002663.003840x2160 4K Ultra HD Resolution IPS panel for wide-viewing angles Multimedia connectivity with Display Port 1.2 and HDMI 1.4 4 x USB 3.0 (1 x fast-charging port) Two 2-watt built-in speakers Adjustable Height Standhttp://click.linksynergy.com/link?id=pvW8vCFKLE8&offerid=997676.19605277364&type=15&murl=https://www.newegg.com/aoc-ag271ug-27/p/N82E16824160296?item=9SIA575DT91489https://c1.neweggimages.com/ProductImageCompressAll640/24-160-296-V01.jpg44583Newegg195657300282021-11-24/02:34:28N82E16824027035Samsung Odyssey Neo G9 49' LS49AG952NNXZA 5120 x 1440 (2K) 240Hz 1ms (GTG) FreeSync Premium Pro G-Sync Compatible, DisplayPort HDMI, Height Adjust.ElectronicsVideo~~Computer Monitors2299.992299.99887276549101Critically acclaimed gamer gear Go Beyond with the Odyssey Neo G9 Spellbinding visual quality World class performance Enter a new era of immersion See Beyond, with HDR2000 Double your discoveries Samsung's biggest 1000R gaming monitor A New Dimension in Visual Design Rapid 240hz Refresh Rate and Lightning Fast 1ms Response Time Make every second count G-Sync and FreeSync Premium Pro Support Make the most of every moment Connect automatically, in an instant Position Perfectlyhttp://click.linksynergy.com/link?id=pvW8vCFKLE8&offerid=997676.19565730028&type=15&murl=https://www.newegg.com/black-samsung-g9-neo-s49ag952n-49/p/N82E16824027035https://c1.neweggimages.com/ProductImageCompressAll640/24-027-035-02.jpg44583Newegg199527333742022-04-30/18:37:429SIAH9BHNJ2113500 Pcs Display Port To Vga Adapter Cable 1080P For Laptop Desktop Game MonitorElectronicsElectronics Accessories~~Adapters~~Audio & Video Cable Adapters & Couplers2272.992272.99990173775716Connection Split/Duplication: None (1: 1)http://click.linksynergy.com/link?id=pvW8vCFKLE8&offerid=997676.19952733374&type=15&murl=https://www.newegg.com/p/30U-00J8-00053?item=9SIAH9BHNJ2113https://c1.neweggimages.com/ProductImageCompressAll640/V2CAD201203F1OOH.jpg44583Newegg199289184482022-04-23/13:38:389SIAKEXFJJ3506ASUS ROG Strix XG27UQ 27' 3840 x 2160 (4K) 1ms 144Hz HDMI, DisplayHDR 400 Adaptive Sync IPS Gaming MonitorElectronicsVideo~~Computer Monitors2045.712045.711928765834703840 x 2160 (4K) 144 Hz HDMI DisplayPort USB 3.0 1,000:1 1.07 Billion Tilt: +20-5 degree Swivel: +40-40 degree Pivot: 0~+90 degree Height Adjustment: 0~120mm VESA Compatibility - Mountablehttp://click.linksynergy.com/link?id=pvW8vCFKLE8&offerid=997676.19928918448&type=15&murl=https://www.newegg.com/black-asus-rog-strix-xg27uq-27/p/N82E16824281057?item=9SIAKEXFJJ3506https://c1.neweggimages.com/ProductImageCompressAll640/24-281-057-V01.jpg44583Newegg189283412542021-06-22/13:33:189SIAP81EX43420Small HDMI Monitor 10 inch LCD Monitor 1366x768 IPS Display w/HDMI VGA BNC AV Inputs Built-in Speaker Compatible with Laptop, PC, CCTV Security.ElectronicsVideo~~Computer Monitors1999.001999.0010 inch Monitor 1366x768 IPS MonitorThis small HDMI monitor comes with a high resolution of 1366x768, 16:9 ratio. Compared with 1024x600 or 1280x800 ones, the image quality is more delicate and realistic. With an IPS viewing angle of 178 degrees, you can look at the images from any angle. HDMI/ VGA/ BNC/ AV Video InputsMulti-inputs for multi-functional use. This 10 inch LCD Monitor can be used as a small second display for PC, CCTV security monitor, bus display, FPV display, gaming monitor, Raspberry pi screen. etc. Note: USB port only has data readable function. Small Portable HDMI MonitorComing with HDMI input, this small HDMI monitor can be used with devices equipped with HDMI output, such as laptop, mini PC, DSLR hdmi camera, raspberry pi, game consoles- PS4, XBOX one. CCTV Security MonitorComing with BNC input, this 10 inch monitor is perfect for CCTV security system and DVR to form a home surveillance system. But if your security camera is a TVI/CVI/AHDhttp://click.linksynergy.com/link?id=pvW8vCFKLE8&offerid=997676.18928341254&type=15&murl=https://www.newegg.com/p/0XZ-06T0-00013?item=9SIAP81EX43420https://c1.neweggimages.com/NeweggImage/productimage/AP81D2008064TA48.jpg44583Newegg200574210382022-05-27/21:52:069SIB7VEHAH9456ROG Strix 43 4K HDR DSC Gaming Monitor - UHD (3840 x 2160), 144Hz, 1ms, HDMI 2.1, Extreme Low Motion Blur Sync, FreeSync Premium Pro.ElectronicsVideo~~Computer Monitors1978.581978.5860659225432843-inch 4K (3840 x 2160) DSC gaming monitor with an ultra-fast 144Hz refresh rate Feature ELMB (1ms MPRT) and support FreeSync Premium Pro technology to eliminate screen tearing and choppy frame rates 4K at 120 Hz via HDMI 2.1 to make the most of the next gen consoles mind-blowing performance GameFast Input Technology minimizes input lag and provides much faster motion delivery from end devices to monitor High dynamic range (HDR) technology with DisplayHDR 1000 certification and 90% DCI-P3 professional color gamut ensures exceptional contrast and color performancehttp://click.linksynergy.com/link?id=pvW8vCFKLE8&offerid=997676.20057421038&type=15&murl=https://www.newegg.com/p/3D4-0060-00018?item=9SIB7VEHAH9456https://c1.neweggimages.com/ProductImageCompressAll640/B7VES2203180L5BI418.jpg44583Newegg200814040802022-06-05/13:54:389SIA8H5HJW1854MSI Optix MEG381CQR Plus 37.5' UWQHD+ 3840 x 1600 175 Hz HDMI, DisplayPort, USB, Audio G-SYNC ULTMATE Curved IPS Gaming MonitorElectronicsVideo~~Computer Monitors1961.841961.848241422303743840 x 1600 175 Hz HDMI DisplayPort USB 3.0 1,000:1 1.07 Billion / 10 bits (8 bits + FRC) Height: 0 ~ 100 mm Swivel: -30° ~ 30° Tilt: -5° ~ 15° VESA Compatibility - Mountablehttp://click.linksynergy.com/link?id=pvW8vCFKLE8&offerid=997676.20081404080&type=15&murl=https://www.newegg.com/p/N82E16824475166?item=9SIA8H5HJW1854https://c1.neweggimages.com/ProductImageCompressAll640/24-475-166-S01.jpg44583Newegg195145355882021-11-03/13:18:229SIAKEYEA30674ASUS CG32UQ 32' (Actual size 31.5') UHD 3840 x 2160 (4K) 5ms (GTG) 60 Hz HDMI DisplayPort Gaming Monitor, Halo Sync, FreeSync, DisplayHDR 600.ElectronicsVideo~~Computer Monitors1864.991864.9919287622109931.5' 4K (3840 x 2160) HDR console-gaming monitor with AMD Radeon FreeSync for Xbox, PlayStation and Nintendo Switch. Halo Sync provides bias lighting (ambient light) to extend the display and reduce glare in high-contrast scenes, matching the on-screen colors to fill your field of vision. High Dynamic Range (HDR) technology with DCI-P3 95% professional color gamut delivers contrast and color performance that meets the DisplayHDR 600 certification. GameFast Input technology minimizes input lag and provides much faster motion delivery from connected devices to the monitor. Console-friendly design features include remote control for adjusting brightness, changing the input and controlling other functions from a distance, and a stand with a built-in USB hub for easier controller charging.http://click.linksynergy.com/link?id=pvW8vCFKLE8&offerid=997676.19514535588&type=15&murl=https://www.newegg.com/black-asus-cg32uq-90lm04f0-b011b0-32/p/N82E16824281011?item=9SIAKEYEA30674https://c1.neweggimages.com/ProductImageCompressAll640/24-281-011-S01.jpg44583Newegg200474446662022-05-24/18:06:569SIA0ZXJB27942Acer Predator CG7 CG437K SBMIIPUZX 42.5' UHD 3840 x 2160 (4K) Gaming MonitorElectronicsVideo~~Computer Monitors1864.131864.131951331297873840 x 2160 (4K) ACM 100,000,000:1 (4,000:1) 1.07 Billion VESA Compatibility - Mountablehttp://click.linksynergy.com/link?id=pvW8vCFKLE8&offerid=997676.20047444666&type=15&murl=https://www.newegg.com/p/N82E16824011425?item=9SIA0ZXJB27942https://c1.neweggimages.com/ProductImageCompressAll640/A0ZXD2205230QYJYWE5.jpg44583Newegg200943905362022-06-09/17:58:279SIB11NJEH1210AOC AGON Curved Gaming Monitor 49' , Dual QHD 5120x1440 @ 120Hz, VA Panel, 1ms 120Hz Adaptive-Sync, 121% sRGB, Height Adjustable, 4-Yr Zero Dead.ElectronicsVideo~~Computer Monitors1799.991799.99685417432882AGON Series Design For Gamer 1 ms (MPRT) Adaptive-Sync Technology (FreeSync™ supported) VESA DisplayHDR™ 400 1800R Curved 5120x1440@120Hzhttp://click.linksynergy.com/link?id=pvW8vCFKLE8&offerid=997676.20094390536&type=15&murl=https://www.newegg.com/black-aoc-agon-ag493ucx-49/p/3D4-001B-00062?item=9SIB11NJEH1210https://c1.neweggimages.com/ProductImageCompressAll640/B11NS220607XU5tQ.jpg44583Newegg191211839062021-08-02/20:20:149SIAVF1FFP5363ROG Swift PG278QR 27" Gaming Monitor 1440p 1ms 165Hz DP HDMI G-SYNC Eye CareElectronicsVideo~~Video Accessories~~Computer Monitor Accessories1772.901772.90Best Quality Guranteed. 27 inch WQHD (2560x1440p) panel with a 1ms response time and overclocked refresh rate up to 165 Hertz embraces ROG standards and design Flexible connectivity options with DisplayPort 1.2, HDMI 1.4 and USB 3.0 ports;Security: Kensington lock NVIDIA G SYNC ensures smooth gameplay by eliminating screen tearing and stuttering; Brightness(Max) 350 cd/square meter Eye Care Technology makes marathons even easier with blue light filter and flicker free back lighting to reduce eyestrain and other eye ailments Game grade ergonomics such as tilt, pivot, swivel and height adjustments allow you to play in your comfort zone; Works with Mac; Adjust the R/G/B color settings or select the color temperature via OSDhttp://click.linksynergy.com/link?id=pvW8vCFKLE8&offerid=997676.19121183906&type=15&murl=https://www.newegg.com/p/15Z-03BM-00003?item=9SIAVF1FFP5363https://c1.neweggimages.com/ProductImageCompressAll640/AP81D200902265A3.jpg44583Newegg200477149402022-05-24/21:44:219SIAFVFE8J3087LG UltraGear 38GN950-B 38' UW-QHD 3840 x 1600 144Hz (160Hz O/C) HDMI, DisplayPort, USB AMD FreeSync Premium Pro Curved Gaming MonitorElectronicsVideo~~Computer Monitors1675.111675.1171919263750438' Curved UltraWide QHD+ (3840 x 1600) Nano IPS Display IPS 1ms (GtG) 144Hz Refresh Rate (O/C 160Hz) 3-Side Virtually Borderless Design VESA DisplayHDR 600 & DCI-P3 98% Color Gamut NVIDIA G-SYNC Compatible with AMD FreeSync Premium Pro Tilt/Height Adjustable Standhttp://click.linksynergy.com/link?id=pvW8vCFKLE8&offerid=997676.20047714940&type=15&murl=https://www.newegg.com/black-lg-ultragear-38gn950-b-38/p/N82E16824026089?item=9SIAFVFE8J3087https://c1.neweggimages.com/ProductImageCompressAll640/AKVHD2012255RALU.jpg44583Newegg200543540142022-05-26/21:50:299SIB0WNFAR0703Lenovo Legion Y44w-10 43.4 Inch WLED Ultra-wide Curved Panel HDR Gaming Monitor With SpeakerElectronicsVideo~~Computer Monitors1624.991624.99193268974333OS Independenthttp://click.linksynergy.com/link?id=pvW8vCFKLE8&offerid=997676.20054354014&type=15&murl=https://www.newegg.com/n-a-lenovo-legion-65earac1us-43-4/p/3D4-000F-00003?item=9SIB0WNFAR0703https://c1.neweggimages.com/ProductImageCompressAll640/AHRCD201005V78Z9.jpg44583Newegg198938043582022-04-08/21:17:259SIA8X5J1N5892Acer Predator XB323QK NVbmiiphuzx 31.5' UHD (3840 x 2160) Agile-Splendor IPS Gaming Monitor G-SYNC Compatible Up to 0.5ms 144Hz DCI-P3 90%.ElectronicsVideo~~Computer Monitors1579.991579.9919513310808931.5' UHD (3840 x 2160) Widescreen Agile-Splendor IPS Gaming Monitor NVIDIA G-SYNC Compatible Refresh Rate: 144Hz Response Time: Up to 0.5ms (G to G) VESA Certified DisplayHDR 400 Pixel Pitch: 0.181mm Color Gamut: DCI-P3 90% Color Accuracy: Delta E<1 Zero-Frame Design 2 Speakers, 4 Watts per Speaker TUV/Eyesafe Certification Ergonomic Tilt: -5° to 25° Height Adjustment Range: 5.12' Swivel: +/- 30° Ports: 1 x USB 3.1 (Type-C) port (Gen 1 up to 5 Gbps) supporting data, power (65W) and DisplayPort over USB-C, 1 x Display Port 1.4, 2 x HDMI 2.1 & 4 x USB 3.0 Ports (Display Port, HDMI & USB Cable Included)</long>http://click.linksynergy.com/link?id=pvW8vCFKLE8&offerid=997676.19893804358&type=15&murl=https://www.newegg.com/p/0JC-000P-00M59?item=9SIA8X5J1N5892https://c1.neweggimages.com/ProductImageCompressAll640/A8X5S2204070VGH0Z4E.jpg44583Newegg196865102902022-01-22/14:16:479SIAV33FEF3201Xiaomi Redmi Monitor 1A 23.8inch 1080P Low Blue Light Slim Eye Protection Computer Gaming Monitor Micro Edge Design for HomeElectronicsPrint Copy Scan & Fax~~Printers Copiers & Fax Machines1545.001545.00Xiaomi Redmi Monitor 1A 23.8inch 1080P Low Blue Light Slim Eye Protection Computer Gaming Monitor Micro Edge Design for Homehttp://click.linksynergy.com/link?id=pvW8vCFKLE8&offerid=997676.19686510290&type=15&murl=https://www.newegg.com/p/330-01MS-007E3?item=9SIAV33FEF3201https://c1.neweggimages.com/ProductImageCompressAll640/AWNSD210430YSBKA.jpg44583Newegg200799386582022-06-04/22:34:289SIA8UCJE99632LG UltraGear 34GN850-B 34' UWQHD 3440 x 1440 (2K) 144 Hz HDMI, DisplayPort, USB, Audio FreeSync Premium & G-Sync Compatible Curved Gaming MonitorElectronicsVideo~~Computer Monitors1497.991497.993440 x 1440 (2K) 144 Hz HDMI DisplayPort USB 3.0 1,000:1 1.07 Billion Height & Tilt VESA Compatibility - Mountablehttp://click.linksynergy.com/link?id=pvW8vCFKLE8&offerid=997676.20079938658&type=15&murl=https://www.newegg.com/p/N82E16824026212?item=9SIA8UCJE99632https://c1.neweggimages.com/ProductImageCompressAll640/24-026-212-S01.jpg44583Newegg190241009302021-07-20/18:58:009SIANK9BTV6435MSI Optix AG32C 32' Red LED Non-Glare Super Narrow Bezel 1ms Response Full HD 1920 x 1080 165Hz Refresh Rate FreeSync Technology Curved Gaming MonitorElectronicsVideo~~Computer Monitors1299.001299.008241421504291920 x 1080 Full HD Resolution 1ms Response Time 165Hz Refresh Rate AMD FreeSync Technology DisplayPort (1.2), HDMI (2.0), DVI Ports 16.7 Million Color Support Anti-Flicker Technology Anti-Glare Screen Frameless Design Red Gaming LED Lightshttp://click.linksynergy.com/link?id=pvW8vCFKLE8&offerid=997676.19024100930&type=15&murl=https://www.newegg.com/msi-optix-ag32c-31-5-full-hd/p/N82E16824475004?item=9SIANK9BTV6435https://c1.neweggimages.com/ProductImageCompressAll640/24-475-004-V14.jpg44583Newegg193509836282021-08-27/09:33:289SIAU2EEMH5733Alienware 27 Gaming Monitor - AW2721D (Latest Model) - 240Hz, 27-inch QHD, Fast IPS Monitor with VESA DisplayHDR 600, NVIDIA G-SYNC Ultimate.ElectronicsElectronics Accessories~~Computer Components1294.981294.98758077475794A lightning-fast 240Hz refresh rate 27-inch QHD resolution NVIDIA G-SYNC ULTIMATE certified VESA DisplayHDR 600 Fast IPS Nano Color technology 4-sided InfinityEdge display Optimized eye comfort with a flicker-free screen and ComfortView featurehttp://click.linksynergy.com/link?id=pvW8vCFKLE8&offerid=997676.19350983628&type=15&murl=https://www.newegg.com/p/1B4-09S3-003D0?item=9SIAU2EEMH5733https://c1.neweggimages.com/ProductImageCompressAll640/AU2ED210515M585R.jpg44583Newegg200604477682022-05-29/04:06:559SIAM8DFTS7470aoc agon curved gaming monitor 49' (ag493ucx), dual qhd 5120x1440 @ 120hz, va panel, 1ms 120hz adaptive-sync, 121% srgb, heightElectronicsVideo~~Computer Monitors1291.011291.0168541772228049' class AGON Professional grade curved gaming monitor with Dual QHD 5120x1440 resolution (It is like having 2x QHD monitors side-by-side) Immersive 1800R curved VA panel with 1ms (MPRT) response time and 120Hz refresh rate (via DP 1. 4) with Adaptive-Sync for smooth gaming Stunning imagery with DisplayHDR 400 certified performance and 121. 6% sRGB and 90% Adobe RGB color gamut coverage, ideal for photo editing Mobile device-ready with USB-C input for convenient docking (DP alt mode for display signal) and charging of your device at the same time (up to 65W via USB-PD) Multiple device input capable with KVM-switch built-in and Picture-by-Picture support that allows for quick switching of USB peripherals based on selected inputs AGON RE-SPAWNED: 4-year Zero-Bright-Dot, 4-year Advance Replacement, 1-year (one-time) Accidental Damage Coverage INPUTS/OUTPUTS: DisplayPort 1. 4 x2, HDMI 2. 0 x2, USB-C 3. 2 upstream + USB 3. 2 x3 downstream, Earphone Out Height-adjustable sthttp://click.linksynergy.com/link?id=pvW8vCFKLE8&offerid=997676.20060447768&type=15&murl=https://www.newegg.com/p/0JC-0016-00301?item=9SIAM8DFTS7470https://c1.neweggimages.com/ProductImageCompressAll640/AJ7WD21031180PJ9.jpg44583Newegg199444356342022-04-27/17:44:039SIA4RE8AA3786Recertified - ASUS ROG PG279Q Black 27' WQHD IPS 2560X1440, NVIDIA G-Sync Gaming Monitor, 165 Hz refresh Rate, Slim Bezel Design with HDMI USB.ElectronicsVideo~~Computer Monitors1286.991286.992560 x 1440 WQHD 100% sRGB with 178 degree Viewing Angel 2X USB 3.0, Display Port 1.2, 1 XHDMI Height Adjust / Pivot / Tilt / Swivelhttp://click.linksynergy.com/link?id=pvW8vCFKLE8&offerid=997676.19944435634&type=15&murl=https://www.newegg.com/asus-pg279q-x-27/p/N82E16824236705?item=9SIA4RE8AA3786https://c1.neweggimages.com/ProductImageCompressAll640/24-236-705-01.jpg -
Hey, Brandon. Can you provide a new authorization key? You can do so via support chat if you prefer not to post here. Just want to build a quick function for this and test it out myself, hopefully come to a solution for you.
-
Here you go! There isn't any secure about them so it's all good: qhsA72TV1REyFf81upi4Bb2iTWCWhRVz
-
Thanks! Here's what I came up with:
[image.png]
Call the API, stored in variable api_1
Create a new variable called "rawxml" to extract the XML out of api_1 using dot notation[image.png]My result is just giving me the output of rawxml with xml_decode filter on it.
[image.png][image.png] -
I don't get it, I have it setup EXACTLY like this and still am getting the error!
Ignore Steps 1-3, those are just generating a token so that the API on Step 4 can make a call. [image.png]
You can see I have the variable setup to simple pull the XML section, no filters or anything else added.[image.png]And in my response is where I look for that variable and apply the xml_decode filter.[image.png]And as usual...[image.png]And nothing unusual in the debugger[image.png] -
As I'm looking at your screenshots I've noticed one thing that is different:
In your response the "rawxml" variable like the rest whereas in mine the "rawxml" variable is black in the Response section. Can't figure out why that is... -
I noticed that as well, not sure it's relevant but good eye! What's important here is in seeing that result, we know what's being passed. I'm continuing to dig into this. Hang tight!
-
Thanks for waiting. I wanted to rebuild the entire function in an API endpoint just to eliminate another difference between what we were doing, and am getting the same error. Going to take this back to the team and see what's going on. Will hopefully have some insight for you in the AM. Thanks for your patience on this.
-
I dug into this. The sample is invalid XML. If you search for the string "Delta E", you will find it is followed by a less than sign and then a number 1. XML doesn't like that. It's like the header snippet that got eaten earlier this afternoon.
I ran the XML through the jsonformatter.org tool I shared upthread, and it errored out.
I tried the raw pull from the rakuten site and it had the same problem, so this is not about Xano.
I made a video showing how to address this using regex_replace. Hope you find it helpful! -
Wow, thank you SO MUCH for putting this together! Implementing this solution right now!
-
I encounteed an interesting new problem regarding your regex setup. In a nutshell, if there are more than one of the same wild less-than-sign's showing up in the same body, Xano only replaces the last one.
I found this by running a new query on an API call and started hitting the same old XML errors I was getting in the beginning. It was that damn Delta stuff again and at first I thought the regex wasn't working because the sign was showing up. Turns out there was two Delta mentions and only the last one was replaced.
Is that how regex normally functions? Just replaces the last instance?
I'm going to guess the solution is to create an if/then statement of some sorts and keep running that regex filter until it doesn't have anything else to replace. -
Yes that's a limitation of regex_replace in xano - no support for the "g" modifier to replace the rest of them. But it's not so bad! Heres a snippet of using a while loop and regex_matches to take care of the additional replaces. [image.png]
-
Hi Chris, can you please share the snippet? I'm having the same difficuilty importing a txt/xml response
Also, why can't I see the screenshot / images. It is super frustrating to learn Xano if no images are available to explain.
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback