Is this a bug in XMLTYPE or it's something that I don't understand?

I wanted to extract a subset of a standard XHTML file.  I thought that I could just put a

XMLTYPE and then extract what I wanted with the appropriate xpath.  My test scenario

is below.  It creates two XMLTYPE objects with the only difference is that one has

and attribute xmlns to the html element and the other does not.  If she doesn't that

attribute, it works as I expected, but with this attribute, it doesn't.

DECLARE

x 1 XMLTYPE.

x 2 XMLTYPE.

S1 VARCHAR2 (4000);

S2 VARCHAR2 (4000);

S3 VARCHAR2 (4000);

BEGIN

" s1: = ' < html xmlns =" http://www.w3.org/1999/xhtml "XML: lang ="fr"lang ="fr"> '; '.

S2: = ' < html XML: lang = "fr" lang = "fr" > ';

S3: = ' < head > < title > Hello World < / title > < / head > < Hello body > < h1 > < / h1 > < body / > < / html > ';

x 1: = XMLTYPE (s1 | s3);

2 x: = XMLTYPE (s2 | s3);

Dbms_output.put_line ('x 1 root present: ' | x 1.) EXISTSNODE (' / '));

Dbms_output.put_line ('x 1 html present: ' | x 1.) EXISTSNODE ('html'));

IF x 1. EXISTSNODE ('/ / h1') = 1 THEN

Dbms_output.put_line ('x 1 < h1 > < h1 >: ' | x 1.) EXTRACT ('/ / h1') .getstringval);

ON THE OTHER

Dbms_output.put_line ('x 1 < h1 > does not exist!");

END IF;

Dbms_output.put_line ('x 2 root present: ' | x 2.) EXISTSNODE (' / '));

Dbms_output.put_line ('x 2 html present: ' | x 2.) EXISTSNODE ('html'));

IF x 2. EXISTSNODE ('/ / h1') = 1 THEN

Dbms_output.put_line ('x 2 < h1 > value is: ' | x 2.) EXTRACT ('/ / h1') .getstringval);

ON THE OTHER

Dbms_output.put_line ('x 2 < h1 > does not exist!");

END IF;

END;

The result of SQLPLUS is:

x 1 current root: 1

x 1 html current: 0

There is no such thing as x 1 < h1 >.

x 2 current root: 1

x 2 html present: 1

x 2 < h1 > value is: Hello < h1 > < / h1 >

Is there something special about 'xmlns '?

I can program around it, but it makes the code ugly and difficult to maintain.

Thank you.

Is there something special about 'xmlns '?

Yes, some thing very special that makes all the difference, it isn't an attribute but a namespace node.

Oracle XML related functions have an optional argument that specifies the namespace mapping to use to resolve XPath expressions.

For example:

SQL > DECLARE

2

3 x 1 XMLTYPE.

"4 nsmap varchar2 (4000): = ' xmlns ="http://www.w3.org/1999/xhtml"';"

5

6 BEGIN

7

8 x 1: = XMLTYPE (')http://www.w3.org/1999/xhtml"XML: lang ="fr"lang ="fr">

9Hello world

Hello

');

10

11 DBMS_OUTPUT.put_line (' this html: ' | x 1.) EXISTSNODE ("html", nsmap));

12

13. IF x 1. EXISTSNODE ('/ / h1', nsmap) = 1 THEN

14

15 DBMS_OUTPUT.put_line (')

: ' || x 1. EXTRACT ('/ / h1 / text () ', nsmap) .getstringval);

16

17. OTHER

18

19 DBMS_OUTPUT.put_line (')

not present!') ;

20

21 END IF;

22

23 END;

24.

This HTML: 1

: Hello

PL/SQL procedure successfully completed

Tags: Oracle Development

Similar Questions

  • The JavaScript notebook appears each time I type; How do I cut this feature? It's annoying to the point that I don't want to use firefox!

    I start a response from hotmail to my friend. Place the cursor in the right place, I start typing... Notepad JavaScript rises, and I have to close and fix what I meant. I'm going to research on the line of address with glasses... Notepad JavaScript rises, I wind attaching it before I know it, so I must close and not save JavaScript notebook until I can return to the address line and type in my search.

    I don't have this development tool. I want to disable Notepad all together. How can I do that... it's so annoying, I want to scream. I almost want to go to Internet Explorer... frustrating!

    Hello RHZ1, the keyboard shortcut to open it is SHIFT + F4. Maybe your F4 - key is stuck and constantly updated fire - can test you with another keyboard?

  • Accidentally, I chose different language that I don't understand on Apple TV. How can I go back to this first stage in?

    Accidentally, I chose different language that I don't understand on Apple TV.

    How can I return to the language selection?

    See change the language on your Apple TV - Apple Support.

    TT2

  • I can't seem to open additional tabs with the +, the drop down menu, or T command? Is this a bug or am I missing something?

    Hello
    I can't seem to open additional tabs with the +, the drop down menu, or T command? Is this a bug or am I missing something?

    I use Firefox 30.0 in OS 10.8.5 on a Mac Book Pro with the Intel Core i7 2.7 GHz and 1333 MHz DDR3 8 GB memory.

    Thanks in advance,
    Pat

    You have a "Community Toolbar" extension installed? Which has been reported by other users of Mac as affecting the new tab feature in Firefox 30.

  • I usually get hyperlinks have advertising, the "moms make money at home? How can one, I get rid of this browser bug?

    I usually get hyperlinks have advertising, the "moms make money at home? How can one, I get rid of this browser bug?
    I downloaded, install and scan with Malwarebytes Anti-Malware laptop several times and it of better, but is still hyper-lier words, with the announcement that the link
    Any suggestions?

    Do a check with some malware malware, analysis of programs on the Windows computer.

    Please scan with all programs, because each program detects a different malicious program.

    Make sure that you update each program to get the latest version of their databases before scanning.

    Alternatively, you can write a check for an infection rootkit TDSSKiller.

    See also:

  • Rotation TIFF files overview reverse colors (black becomes white and white black). Is this a bug?

    Rotation TIFF files overview reverse colors (black becomes white and white black). Is this a bug?

    Of course, sounds like it.  However I don't see this behavior on a test screenshot.

    Bug Reporter https://bugreport.apple.com/

  • After updating to Firefox 15 it crashes at the end of a javascript call window.close (); opener.alert ('test'); Does work as expected or is this a bug?

    After updating to Firefox 15, it crashes after a popup called javascript window.close (); opener.alert ('test'); Does work as expected or is this a bug?

    It works better if you disable the modal prompt temporarily as a test by setting prompts.tab_modal.enabled false on the subject: config page?

  • Is this a bug or I use bad indicators in userChrome.css

    I wish I had my auto-hide bookmarks bar until I move my mouse on the location. I found a code earlier to do it, but I've never really tried so far with FF4. When I put the code and move the bookmarks bar in the Panel of the obligation to hide, it works fine until I open a new window or exit / restart of the browser.

    #PersonalToolbar {display: none;}
    #navigator-toolbox:hover > #PersonalToolbar {display: -moz-box;}
    

    Auto-hide to the hover works very well with the box, but the bookmarks bar is completely empty. No arrow, just empty space. Whenever I commented the line in userChrome.css, the buttons reappear. When I move the bookmarks bar and then reactivate the line and restarting, the buttons are fine when I move them in back and forth until the next exit.

    I tried this on three machines (all Windows 7, 32-bit and 64-bit), and the behavior is the same. I also tried to disable all the modules and extensions without change in the results.

    Is this a bug or I have the wrong indicators used (-moz - box)? Thanks for all the ideas/help provided.

    So bad, I don't think it works.

    ---

    I think that display: - moz - box is correct.

    What happens if you try to change a style different, such as the height attribute?

    /* Bookmarks Toolbar */
    #PersonalToolbar {height: 1px;}
    #navigator-toolbox:hover > #PersonalToolbar {height: 26px;}
    
  • When I use Firefox to watch the changes I make to the HTML files locally, it does not show changes made to images, unless I restart the browser. Is this a bug?

    I have the local and versions at distance of a page is open in two tabs. I change images (keeping the same name in the HTML code) and download the modified image. The tab that displays the remote page does a refresh to show the change. The tab showing the local page of do not. I tried to open it in a new window, but it still doesn't change. Only if I restart Firefox does show the change. Why? Is this a bug?

    Try using Ctrl-Shift-R or Ctrl-F5 to reload the page. This tells Firefox to reload all the content on the page, ignoring cached assets copies.

    I don't know why this is happening in the first place, although I suspect it may have something to do with the fact that the remote copy is loaded from a web server (including a bunch of headers allowing browsers to know when we need to get a new copy of an asset), while the local copy is loaded directly into the file system.

  • Is this a bug?

    Earlier, when I cleaned the Home button, it happened: the icons are sinking...

    Is this a bug? My system is iOS 9.2

    No, it's not a bug. This is a feature called accessibility to hand develop the icons at the top of the screen when you use the phone with one hand.  It is enabled or disabled by double-clicking (not not pressing) the Home button, which made you so clean.

  • The button create a new paragraph style does not work for me, is this a bug or something stupid I did?

    The button create a new paragraph style does not work for me, is this a bug or something stupid I did?

    Pages on El Capitan 10.11.1 v5.6.1.

    I just created a quote indented using ITC Garamond Book Italic with left and right margins altered. Well selected, I clicked on the + symbol in the paragraph, named the new Styles pop-up style Indented quote and you press return.

    Always selected in the body of the document, I applied the body paragraph Style to restore the normal formatting and then with the text again, the paragraph of citation Style indented - who worked as expected.

    If you want that your new Style of paragraph to survive across documents, you will need to save it in a model. You can also have two different Pages, documents open in Pages v5.6.1, and copy/paste the custom styles between the selected text in these documents by using the Format menu.

  • I got a Message from SeqEdit.exe problem when it is inserted expression, is this a bug?

    I have tried to insert a phrase in the browser of the Expression to evaluate limits, but whenever I chose "insert" he displied a problem SeqEdit.exe post and quited TS.

    The problem was always with the same phrase. There are 3 seals files to show the problem. Is this a bug or I do something wrong?

    I'll appreciate your help.

    H.P.

    Here's a quick solution to be able to use the browser of the Expression to insert functions. (Once you add the CheckLimits() function to remove the final closing ')'. Fill the rest of the function with the expected arguments 4 and then add a closing ')'.

    This is the prototype of CheckLimits

    CheckLimits (number value, number, low number, String comparisionType, Boolean, optional doNotCopyToResults = TRUE)

    Kind regards

    Steven Zittrower

    Technical sales engineer

    National Instruments

    http://www.NI.com/support

  • Is this a bug in the xy-Graph?

    Hi Forum,

    I came across this problem while working on this thread (http://forums.ni.com/ni/board/message?board.id=170&message.id=478607#M478607).

    I add values from 0 to 1 to a graph XY-like in the image below. (And only in this way!)

    When the user presses print a chart reference is managed by a subvi.

    In this sub - VI, there is another graph XY.

    Now, I copy all the important properties of the MainVI-XY-Graph to the Sub-VI-XY-graph.

    What is happening inside an another sub - VI, but it's not bad. The copy process may also occur within the first Subvi. Just a space saver.

    Then the Image of the Sub-VI-XY-Graph is printed via a method node.

    What I found is:

    Run the MainVI (Subvi SHOULD NOT BE OPENED)

    Change the scale of the x axis (for example, the scale of the x-axis of 0.0 to 0.1)

    Press on print

    The c:\pic.bmp file contains the chart, but the scale won't be 0-1 0.0 to 0.1!

    If you run with the Subvi is showing, it won't happen.

    And if you set the graphic content xy like this:the error does not occur.

    For those who follow me here:

    What's in my mind or IS THIS a BUG?

    Thanks for reading

    Christian

    Properties applied to hidden objects (or objects on the screens that are not open) are usually "noops" for performance reasons. If you think that I misread your description please post back.

    Ben

  • PanelBounds vs "Panel Bounds" is this a bug?

    Hi all

    A VI that essentially a quirk I see is attached. It's LV 8.6.1 so it may have been noted/corrected now, I just want to see.

    If I drop a FP. Property node PanelBounds, I get slightly different typedef if I create a constant depending on whether the node is configured to write or read.

    The differences are quite subtle, the text has different capitalization and the name of the cluster is also different.

    Is this a bug?

    Sorry for the big VI attached, I really haven't had time to do a more effective (graphically) version.

    Hi, PNR,.

    I can see this behavior in LV 2009 SP1 and did not find any car exceptional I deposited a CAR with number #234695.

    Thank you for this comment.

    Kind regards

  • Someone at - it a repair for a function that is usually common in Windows, the Svchost.exe process? I and many other users of PC have infested with this mystery bug. Its not to damage yet, but...

    I'm infected w / which seems to be the most mysterious infection known for Windows right now.  One wonders if it's a Trojan horse, worm, malware, etc., or just a natural process for C: Windows\system32.  It's almost like 'shadow people '.  For most, there quite harmless, fantasy of the mind.  But, from time to time, there is actually something that happens on the corner of your cornea, so to speak.  This is very sneaky and difficult to diagnose a problem b/c he hides with the Service host.  I'm here b/c I have a question, but also to help others to understand that, unlike the 'shadow people', the shadow of an infection is very REAL.  This infected process is, for the most part, quite harmless unless something malicious attaches to it and could things get a bit risky.  Anyway, I'm sorry for this rambling diatribe, but I have a question for someone who is very smart b/c so far it seems not yet to be a definitive repair because some people still think it's a natural function or process in the Windows operating system.  So here it is: How can I solve this problem?  And I can fix it with or without a full restore of my records?  I'd really appreciate any input on this very discouraging, boring, mind and body draining, faulty computer "BUG".  BTW, I have a dv9500 HP Pavilion x 64 Ultimate for Vista that was bought there are 3 1/2 years.  I've dealt with this infection since the end of February and have spent more than $400 on this terrible nuisance.  But Club (all jokes aside), I really enjoyed, grateful and very thankful for someone with an answer to this complicated issue.  Thanks for the time!

    Hello

    read this information

    What is svchost.exe and why it works?

    http://www.howtogeek.com/HOWTO/Windows-Vista/what-is-svchostexe-and-why-is-it-running/

Maybe you are looking for

  • Can I use 800 x 600 for the tablet on a Portege M400-146 mode?

    I would prefer not to have to change resolution whenever I go to Tablet mode.Is there a work around to use 800 x 600, a screen resolution I find it more comfortable for my eyes, please? John

  • 4540 proBook s: Intel Centrino Advanced - N 6235 WLAN card drivers needed

    I have a ProBook s 4540 and accoding to the service manual, I can use the 670292-001 Intel Centrino Advanced - N 6235 WLAN card. I bought one on ebay. Can someone point me in the direction of the link with the service pack that contains the drivers f

  • Cannot mv or cp to/usr/share/dict

    Hello! I had a few word list files in my/usr/share/dict directory which has not made the transition to El Capitan, for some reason any. Fortunately, I had copies of some of these files in another directory, because I did not notice the gap for awhile

  • Loading when made up!

    When I try to make a call, a loading icon and he keeps circling for a while before the call actually start!Someone at - it any idea why and how get rid of?! :-?

  • ThinkPad Edge E530 BIOS

    I've updated my (initially Windows 7 equipped) Thinkpad E530 to the latest version of the BIOS version 2.55. I also installed Windows 8.1 x 64 on it. My question is: can I use the "OS Optimized Defaults" in BIOS or not? In the BIOS install descriptio