Validate XHTML in a trigger

I have a field that is a varchar2(4000). We have a need to verify that all values coming into it are valid XHTML. Actually, the portion of the XHTML that is being inserted is the portion inside the <body></body> tags. So, I can validate that it is valid XML with the following trigger, but I need to validate it is valid XHTML according to http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd. Any ideas?
create or replace TRIGGER "00347533"."XMLTEST2_BIUFER" BEFORE
INSERT OR UPDATE ON "XMLTEST2" FOR EACH ROW
declare
var sys.xmltype;
begin
     var := XMLType('<html xmlns="http://www.w3.org/1999/xhtml"><head><title></title></head><body>' || :new.test || '</body></html>', 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd');
end;

OK, first thing I would have started with would have been registering http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd. directly ontp the repository...Can this be done via a XSD...? From there validation should be possible....

Similar Messages

  • WHEN-VALIDATE-ITEM results at a block/form

    Hello friends at www.oracle.com ,
    as we know, WHEN-VALIDATE-ITEM is a trigger used for item validation. But if I use WHEN-VALIDATE-ITEM at a block, or even at a form (since Oracle Forms editor allows me to add a WHEN-VALIDATE-ITEM trigger at a block/form), what's the effect of it? How will WHEN-VALIDATE-ITEM behave in such situation?
    Thanks, and best regards,
    Franklin Gongalves Jr.

    From forms documentation (ever considered to read it?):
    A trigger must be attached to a specific object in the form, either an item, a block, or the form itself. The object to which a trigger is attached defines the scope of the trigger, and so helps Form Builder decide which trigger to fire when the corresponding event occurs. Not all triggers are relevant to all objects. For example a When-Button-Pressed trigger would not be attached to a display item.
    That means, a when-validate-item-trigger at block level fires for ALL items of the block,
    except those ones who have an own when-validate-item-trigger at item level that has the
    property "Execution hierarchy" set to "override".

  • XML validation: how to check ALL validation problem for XHTML

    I have a lot of documents in HTML format (not very good) that I would like to convert in XML (XHTML). I know it is not so easy and I would use this strategy in a Java program:
    1. Try to check the well-formness and validation with a XML parser (SAX or Xerces)
    2. If not valid: try to individuate ALL the problems the file has (*and not only the first one that halts the processing process*)
    3. Try to transform the HTML to a validable XHTML with some approach: regular expression or other methods
    So the questions I do to you are the following:
    1. What XML parser do you think is the best for this purposes? SAX or Xerces?
    2. How can I understand what are all the validation problems in the file and not only the first one (If I remember well XML parsers halt the parsing process at the first error...)?
    3. How can I transform the HTML to a valid XHTML? I have only to use RegEx or is there other tools to do this for XHTML and HTML problem?
    Thanks
    r
    Edited by: robertobat on Feb 21, 2009 7:09 PM

    >
    1. Neither of them. (Disregarding the fact that SAX and Xerces aren't in the same category and don't cover all the possibilities.I would say SAX default implementation in JRE and SAX parser in Xerces.
    2. I think you have "valid" and "well-formed" confused. And HTML isn't a dialect of XML so the idea of trying to use an XML parser to handle HTML isn't a good idea.I know very well what is the difference between valid and well-formed but I've used "validation" to represent all the conversion problem. But you are right. I'm convincing myself that using a XML parser as the first step is not a good idea.
    3. Well, this is the real question, isn't it? Those other two were just a waste. Don't screw about with regex, for one thing it doesn't work well for hierarchical structures and for another you won't finish in a finite time. Just use an HTML parser which can produce a DOM, like TagSoup for example. Or run them through HTMLTidy. You could also submit them to one of the internet sites which will validate XHTML for you.I've seen Tidy and its capability to convert an HTML to a XHTML and I think it is better then TagSoup because I have to implement this mechanism in a production environment and I want to use only open source projects that have a very long story and that are strong. But I'll see TagSoup as you say.
    I cannot use an Internet service to convert millions of private documents.

  • Difference between ENTER and VALIDATE built ins

    Hi,
    Can anyone of you tell me what is the difference between ENTER and VALIDATE? Also in ENTER if any program unit is called and on that program unit I've specified FORM_TRIGGER_FAILURE it is not stopping. Can anyone give some information?
    Thanks in advance.
    --Sourav                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Thanks Gerd. I've used both ENTER and VALIDATE in KEY-COMMIT trigger, problem is whenever any validation unit raise FORM_TRIGGER_FAILURE, it doesn't stop execution flow of key-commit. Here I'm giving some sample codes
    IN KEY-COMMIT
    message(' Key Commit -1');
    message(' Key Commit -2');
    message(' Key Commit -3');
    message(' Key Commit -4');
    ENTER;
    message(' Key Commit -5');
    message(' Key Commit -6');
    Evenif the item has a When-Validate-Item trigger and in trigger we raise FORM-TRIGGER_FAILURE, still message 5 and 6 is showing.
    I've to use FORM_SUCESS after ENTER or VALIDATE to get the exception.
    Any idea?
    Regards.
    --Sourav                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Don't know which technology to utilize or how to configure ASA5505

    I have an ASA5505.  Currently, it is using static NAT on several ports to forward traffic to several devices inside my network.  It is a pain not only to configure but from the end user side.
    The issue I am having is the applicatoins I am using to access the devices become a mess with dual configurations, one for when I am connected to the internal network and one for when I am away from the office and accessing from the internet.  For example, I have 2 Cisco VC240 IP Cameras behind the ASA5505.  One is set use port 9091 and the other 9092.  When I am inside the office, I access them via http://10.1.2.215:9091 and http://10.1.2.216:9092.  But when I am away from the office, I have to have another configuration in an Android app to use them, http://external_ASA_IP:9091 and 9092 and then NAT 9091 to the object for Camera1 and 9092 for Camera2.  This is only one scenario.  I also have a UC320W that I would like to put an IP phone at home and it sounds like AnyConnect is the only way to do this.
    It sounds like to me that if I use some type of VPN, I can access the same devices using the same IP whether internal or external with the external connection using the VPN to tunnel the IP to the local network.  There seems to be quite a few ways to do this with an ASA 5505.
    AnyConnect seems like the way to go but after reading Cisco documentation, it requires your Android device to be root'd if it is not a particular Samsung model.  If I understand correctly, root'ing your phone voids the warranty.  I know it is common practice but would think Cisco would have a better solution as I am sure Cisco would not want another manufacturer telling their customers to void the warranty on their Cisco equipment in order to get it to work.
    I believe I can just use IPSEC and use the native VPN of the Android OS and also tunnel L2TP as the Android supports IPSEC-PSK/L2TP or IPSEC-CRT/L2TP.  But will either of these will support the IP phone to the UC320W?
    A friend also told me to use NginX to proxy URL's so the URL http://www.fqdn.com/camera1 gets proxy'd to the internal IP of Camera1 and http://www.fqdn.com/camera2 gets proxy'd to Camera2.  He says I should be able to store a cookie on the phone and let the phone authenticate to the camera and if the phone cannot, the proxy can authenticate internally to the IP camera over SSL.
    I don't know anymore, I am so confused and just want to simplify my life as I am just a small business with me and a couple other employees but I have full-time job and it is not IT/Network Technician, it is only CTO/CEO/CIO/CFO.  I don't have hours upon hours to set this up and test and I don't have hours upon hours to manage it.  I just need to simplify this and have so that it is a set-it-and-forget-it for 6 months to 1 year and re-evaluate or update.  So, if someone suggests IPSEC, I would not know how to configure anyway and you should expect another post.  The same for AnyConnect or any of the other suggestions.
    Thanks in advance for any advice.

    Hi!
    1. Set Calculation Mode property of ITEM_5 to Formula.
    Formula property:
    nvl(:Block_Name.ITEM_1, 0) + nvl(:Block_Name.ITEM_2, 0) + nvl(:Block_Name.ITEM_3, 0) + nvl(:Block_Name.ITEM_4, 0)
    OR
    Function_Name(Param_1,... Param_N);
    Have in view of, that the ITEM_5 data will not be saved in DataBase.
    2. When-Validate-Item trigger is usfull when is necessary to store calculated item data in DataBase.
    Rename you Post-Query trigger to When-Validate-Item.
    Modify trigger: Store calculation result in the variable.
    (Don't forget to round variable value!)
    Then compare it with ITEM_5. If they are different - :ITEM_5 := var_name.
    I prefer the first method.

  • Calling custom form from another custom form giving problem

    Hi
    my requirement is when i am populating value in one form field from LOV ,
    i wrote when-validate-item trgger
    this trigger calls in turn another form for approval
    so i use the following command in trigger
    DECLARE
    -- variable added by deepak on 16-05-2006 starts here
         --to make PROF_description enterable
         L_PROF_TERM_WARNING_AMNT NUMBER;
         L_PROF_TERM_AMNT NUMBER;
         L_PROF_DEPOSIT_PAID NUMBER;
         L_AUTORIZATION VARCHAR2(1);
         --variable added by deepak on 16-05-2006 ends here
         --code added by deepak on 16-05-2006 starts here
         BEGIN      
                        BEGIN
                             SELECT PROF_TERM_WARNING_AMNT ,PROF_TERM_AMNT ,PROF_DEPOSIT_PAID ,AUTORIZATION
                             INTO L_PROF_TERM_WARNING_AMNT,L_PROF_TERM_AMNT,L_PROF_DEPOSIT_PAID,L_AUTORIZATION
                             FROM XXPOS_CUSTOMER_PROFILES_GTB XCP
                             WHERE XCP.PROF_DESCRIPTION = :POSTPAID_DET.PROF_DESCRIPTION;
                        END;
                        BEGIN
                        IF L_AUTORIZATION ='Y' THEN
                             :GLOBAL.auth_user_id := NULL;
                             FND_FUNCTION.EXECUTE( FUNCTION_NAME=>'XXAUTHSC',
    OPEN_FLAG=>'Y',
    SESSION_FLAG=>'NO_SESSION',
    OTHER_PARAMS=>NULL,
    ACTIVATE_FLAG=>'ACTIVATE',
    BROWSER_TARGET=>NULL);
                        IF :GLOBAL.auth_user_id is not null THEN
                             :POSTPAID_DET.PROF_TERM_WARNING_AMNT := L_PROF_TERM_WARNING_AMNT ;
                        :POSTPAID_DET.PROF_TERM_AMNT := L_PROF_TERM_AMNT ;
                        :POSTPAID_DET.PROF_DEPOSIT_PAID := L_PROF_DEPOSIT_PAID ;
                        ELSE
                             RAISE Form_Trigger_Failure;
                        END IF;
                        ELSE
                        :POSTPAID_DET.PROF_TERM_WARNING_AMNT := L_PROF_TERM_WARNING_AMNT ;
                        :POSTPAID_DET.PROF_TERM_AMNT := L_PROF_TERM_AMNT ;
                        :POSTPAID_DET.PROF_DEPOSIT_PAID := L_PROF_DEPOSIT_PAID ;
                        END IF;
                        END;
              END;
    but while running it is giving error:
    it is not popup the desired second window and displaying following error
    Illegalrestricted procedure OPEN_FORM in when-validate-item trigger
    IF anyone has any idea on this, it will bw highly appreciated.
    regards
    deepak

    You can use a timer in your when-validate-item trigger. In the when-timer-expire trigger you can call the procedure open_form

  • Html files with included php: related files, code color?

    Hi there,
    Wow, what an active forum!
    I have two questions about html files that include php.
    Almost all my html files have this structure:
    <?php
    (php stuff)
    require_once 'somefile.php';
    ?>
    (html stuff)
    My first question is, is there any way for DW CS4 to display the files included this way? At the moment, they don't show up in related file view.
    My second question is, is there any way for DW CS4 to display the html and php code in the file in a pleasant way? The php is not red as it is in pure php files.
    Definitely not wanting to change the way I code or to change the file extensions...
    Instead, wanting to change the SW settings to make my work easier.
    With gratitude,
    Smiles
    Andy

    Hi Brad,
    Thanks for your reply!
    > The PHP coding in a regular HTML page likely won't even work in a  browser
    That's a standard coding technique...LOL... Maybe I didn't explain correctly...
    My hundreds of pages validate XHTML transitional...
    You are quite right that browsers do not interpret php code, but the  browser never sees php code.
    I will try to explain again
    The html file starts with <? php (code> ?>
    When the browser calls the html file, the server knows to process the file as php.
    It processes the php, then returns some html headers, and follows up with all the html that is after the <? php (code> ?> section.
    Thousands of php coders work like this.It's a very efficient way of building a modular website while keeping html extensions.
    By the way, related files already show in CS4 if they are in the html code.
    Are you 100% sure you are correct about the CS5 inclusion situation? You won't know unless you have built an html file that looks like this.
    <?php
    require_once 'myfile.php'>
    ?>
    <body>
    hello html
    </body>
    Your myfile.php might look like this:
    <?php
    echo 'hello php <br />';
    ?>
    If you have never used php in an html file, you will probably need to add something like this to your .htaccess file:
    AddHandler application/x-httpd-php5 .php .htm .html
    It tells your server that php processes not only php files but also html files.
    Warmest wishes to all,
    Andy

  • Don't know which triggers to use, please help.

    Hi,
    I'm a newbie to forms. I have a question about what triggers to use for my situation. I can't seem to find many examples for what I want to accomplish. I have tried using the online help (within forms) but sometimes they don't always have examples for their triggers).
    Here's my scenario:
    I have six items, five of which are text database items and one is a non-database display item (TOTAL). Each of the first 5 items holds a numeric value and the TOTAL item will store the sum of the previous 5. Of first 5 items, only the 4th item (POINTS) can be updated within the form (and I have set the Enabled propety to 'No' for the first 3 items). I have a function, TOTAL_COUNT, that will do the sum calculation and it works fine in a POST-QUERY trigger populating the value into TOTAL. However, what I'd like to do is anytime a user enters a new value in POINTS and then tabs or mouse clicks into the next item TOTAL, I'd like to call my function to update and display the new total value in TOTAL.
    Does anyone know which triggers and/or code I can use to accomplish this? The code I use to call a function is:
    :block_name.item := function_name(:parameter)
    For your recommed triggers, can I just use that code to call my function or will I need any other syntax i.e. BEGIN...END, etc within the trigger body?
    Any quidence would be greatly appreciated.
    Thank you,
    Eric

    Hi!
    1. Set Calculation Mode property of ITEM_5 to Formula.
    Formula property:
    nvl(:Block_Name.ITEM_1, 0) + nvl(:Block_Name.ITEM_2, 0) + nvl(:Block_Name.ITEM_3, 0) + nvl(:Block_Name.ITEM_4, 0)
    OR
    Function_Name(Param_1,... Param_N);
    Have in view of, that the ITEM_5 data will not be saved in DataBase.
    2. When-Validate-Item trigger is usfull when is necessary to store calculated item data in DataBase.
    Rename you Post-Query trigger to When-Validate-Item.
    Modify trigger: Store calculation result in the variable.
    (Don't forget to round variable value!)
    Then compare it with ITEM_5. If they are different - :ITEM_5 := var_name.
    I prefer the first method.

  • Developer 6 Form

    * I would like to run the Forms on the Web without the default MDI window and toolbar, is it possible to hide these and customise your own? and how?
    * Do you include images, hyperlinks and list items as such when you developing the form or do you include it on the web page in the HTML code?
    Does anyone know any sites that use Oracle Developer Form 6?
    Thank you.

    You might try checking the actual value of the item. While the when-list-change trigger won't file, I don't know why, the movement to another field can be used with the when- validate, or post-change trigger. Then the value in the tlist field will be readable for what was selected. You can set the initial value to NULL as well.

  • Developer 6.0 Form

    How can I check which item in a tlist is selected?
    I used to check whether the tlist control is null to determine if any thing selected, but it does not work when depolying the same form in web.
    It seems that oracle cannot detect any list changed event even if item is highlighted with mouse click.
    null

    You might try checking the actual value of the item. While the when-list-change trigger won't file, I don't know why, the movement to another field can be used with the when- validate, or post-change trigger. Then the value in the tlist field will be readable for what was selected. You can set the initial value to NULL as well.

  • How to make emplyee category mandatory

    Hi,
    I will make the emplyoee caterogry field in the assignment as mandatory. Please advice.
    I done follwowing:
    1. Triger Event: when-validate-record
    2. Trigger Object: ASSGT
    3. in the action: Please enter a value for Employee Category as warning. But i weill have the field will be marked as yellow(like another mandaory fiield), when i enter into this form.
    Thx
    Mehdi

    I set the target object : ASST.EMPLOYEE_CATEGORY_MEANING, TRUE. In the Property Level I jut put Super HRMS Manager. But if i create a new employee, and give nothing, then it will be accepted. I want to be able to enter only valid values and not a empty value. I casye of Supervisor (Assignment form) it works propereley, but the same thing here has no effect. That is because it looks a like a little bit streng. Required field is required field, but it should not accept null value.
    Please advice if you have some suggestions.
    Thx
    Mehdi

  • JavaScript tags case change

    I an currently recoding a site to validate XHTML 1.0
    Transitional. One of the changes is to make all JavaScript tags
    lower case so that onMouseOver becomes onmouseover; onMouseOver is
    not valid.
    The problem is that DW rewrites these tags every time I open
    the file even though I have made the correct settings in
    Edit>Preferences...>Code Rewrite. I am using .PHP files and
    they appear in the list of files not to be rewritten. Also, I have
    set validation to XHTML 1.0 Transtional, so DW should know that
    this is wrong!
    This is very frustrating. Can anyone tell me how to stop
    this?
    Thanks

    > This is very frustrating. Can anyone tell me how to stop
    this?
    Add an XHTML doctype to the page. Then you can use COMMANDS |
    Clean up
    XHTML....
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "DigiHead" <[email protected]> wrote in
    message
    news:e667t3$p88$[email protected]..
    >I an currently recoding a site to validate XHTML 1.0
    Transitional. One of
    >the
    > changes is to make all JavaScript tags lower case so
    that onMouseOver
    > becomes
    > onmouseover; onMouseOver is not valid.
    >
    > The problem is that DW rewrites these tags every time I
    open the file even
    > though I have made the correct settings in
    Edit>Preferences...>Code
    > Rewrite. I
    > am using .PHP files and they appear in the list of files
    not to be
    > rewritten.
    > Also, I have set validation to XHTML 1.0 Transtional, so
    DW should know
    > that
    > this is wrong!
    >
    > This is very frustrating. Can anyone tell me how to stop
    this?
    >
    > Thanks
    >

  • IWeb Coding Error?

    I have recently created several web pages using iWeb '08 and published on a third-party hosting site (not .mac). A few people who have looked at the sites tell me there is a problem, many cannot see the navigation bar. I have read the forums and there are a number of useful suggestions that address this problem, which is usually due to the users system settings.
    However, in asking people whose business is creating websites, I learned about a site to validate xhtml code (http://validator.w3.org/). I used the site and found that about half of my pages are fine, but the other half have an identical error. Here is a transcription of the error:
    Line 143, Column 201: there is no attribute "allowTransparency".
    …0" marginwidth="0" allowTransparency="true"></iframe>

    You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).
    This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.
    How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.
    Again, this appears on about half of my pages. This sounds like a problem in iWeb creating the code. Has anyone encountered similar problems or can someone offer a fix?
    Thanks,
    Brad

    does it solve the problem?
    I think the problems you have mentioned are unfortunately often caused by the different ways different browsers can display the same code. Zero validator errors would not likely make a difference, and some obsolete browsers like IE5 may never work properly.
    Regarding navigation menus, if it is a serious problem for your viewers, you probably need to turn off iWeb's navbar and make your own using simple hyperlinks.
    Regarding fonts, if viewers' machines don't accurate show what you intended, you may need to turn your text into graphics by adding an invisible amount of shadow.
    Regarding layout differences, it's hard to provide any general advice.
    In the end, if accommodating a wide range of browsers is essential, iWeb may not be the best app for the job (and no major changes in the way it works are likely for a couple years). I don't know how much better the various alternatives are, but pros normally use Dreamweaver I think.

  • Maintain vertical scroll position on long Accordion

    Hi,
    I've got a accordion with five tabs. The content exists of lists with links to different pages, so basically a menu ;-). Some tabs are quite long, when the list exceeds 450 px I got a scrollbar appearing other wise the list is just to long. Now what I want is to maintain the exact vertical scroll position after clicking on items from page to page.
    I had this sorted with a javascript but I had to add an "onscroll" attribute to the accordion div which doesn't validate (xhtml 1.0 transitional).
    Not validating attribute onscroll: <div id="Accordion1" class="Accordion" style="height: 450px"; onscroll="setScrollPos();">
    Can somebody help me with a validating alternative?
    I googled endless for this one ...

    If you have any extensions installed in Safari > Preferences > Extensions, turn that OFF, quit relaunch Safari to test.
    hit the back button
    By the way, the Delete button feature to go back a page has been omitted in Safari 6.
    Try Command and the back and forward arrows.

  • When-validate-item trigger restriction on open form or call form

    W have when-validate-item trigger. I need to place a code here that will bring up a form when the "valid entry" on the item has been made. I am getting a frm-40737:Illegal restricted procedure COMMIT...
    Code snippet on the procedure that I am calling from the when-validate-item:
    IF :System.Form_Status = 'CHANGED' THEN
    Commit_Form;
    end if;
    Call_Form ('MY_FORM', HIDE, NO_REPLACE, NO_QUERY_ONLY,'PARAM');
    Is there a work-around. We also cannot use timers here.
    Any help is appreciated?
    TIA

    Thanks Sudha, I tested and it worked with the key-next-item trigger.
    The only thing though, I was told that the users will not use the enter key when they navigate out of the field, it is either clicking on an exit button or function key F4...so I am still stuck with the same problem.
    This site is really helpful and I hope to receive more ideas.
    Thanks!

Maybe you are looking for

  • How do you find out what application is generating a plist file in your preference folder?

    I have had two similar warnings come up in Drive Genius 3, a program that I use to manage my drives.  The warnings occur during a daily verification of preferences on my main drive, a 256GB SSD.  They state: "The preference file at '/Users/me/Library

  • Uninstall PSE 9 with Windows 8

    I am trying to uninstall photoshop elements 9 after installing PSE 12. I am using Windows 8 and all the instructions I have found to manually uninstall are for Windows 7 or Windows XP. I keep getting an error message like the one shown below.

  • Business Place & Section Code in J1INMIS

    In F-48 Business Place and Section Code are entered.  Even then, in J1INMIS Section Code is missing and not seen in the report.  Only Business Place is coming.   What could be the reason?

  • Why can't I download Itunes/quicktime????

    When i try to install the new version on itunes when it gets to the quicktime part it says it cannot remove the old quicktime software and to contact my technical support group

  • JAAS, JGSS Kerberos  and windows 2000 newbie question

    Hi I have setup a Kerberos server on windows 2000, now i want to write code in java to authenticate and authorize user using Kerberos , I know I have to use JAAS, JGSS, is there a how to document to setup a client machine, like setup krb4.ini file an