C Parser Functionality
I would like to perform read and write functions on XML
documents.
For example, I would like to be able to Update a document within
the database using a given criteria.
Is it possible to do this ?
Many thanks,
Nigel
null
Currently our XML SQL Utility supports Reads and Writes but not
updates. There is no announcement on when. If you need C
versions, those are in development but are significantly behind
the Java ones.
Oracle XML Team
http://technet.oracle.com
Oracle Technology Network
Nigel Robbins (guest) wrote:
: Hi there,
: The background behind my question is as follows.
: Our existing application reads/writes data to flat files.
: We are enhancing our application to use an Oracle database. We
: also want our data to be flexible and hence would like to use
: XML.
: We need to perform read and write (insert, update, delete)
: operations on our data.
: The sort of functionality we were hoping for is like that
: offered by SQL for relational data (e.g. UPDATE <part(s) of
: document> WHERE ...).
: Best regards,
: Nigel
: Oracle XML Team wrote:
: : Can you be more specific on what you mean by update?
Currently
: a
: : whole XML document is stored in a LOB and I don't know how
: this
: : can be updated without relacing the document.
: : Oracle XML Team
: : http://technet.oracle.com
: : Oracle Technology Network
: : Nigel Robbins (guest) wrote:
: : : I would like to perform read and write functions on XML
: : : documents.
: : : For example, I would like to be able to Update a document
: : within
: : : the database using a given criteria.
: : : Is it possible to do this ?
: : : Many thanks,
: : : Nigel
null
Similar Messages
-
Oracle XML parser functionality
I would like to clarify the following about Oracle XML parser:
1. checks if the parser resolves and inserts tags that were omitted in tag minimization?
2. checks if the parser will suggest ways to correct errors when encountering such error conditions?
3. checks parsing errors when the DTD does not allow some elements to be nested?
Would really appreciate a detailed explanation on the questions above.
Thanks.I would like to clarify the following about Oracle XML parser:
1. checks if the parser resolves and inserts tags that were omitted in tag minimization?
Would you be more specific?
2. checks if the parser will suggest ways to correct errors when encountering such error conditions?
Would you be more specific? What kind of errors?
3. checks parsing errors when the DTD does not allow some elements to be nested?
Support. -
I have saved the XML data into a variable and want to retrive the values in XML and store them in separate variables.While trying to do this with Parsing I encounter an error in DOM creation.I have tried out following codes in Form:Ready event.But those are not working.
When I place a messagebox on top of the line which creates DOM its displaying the message.But it is not displaying when I place it in line next to line which creates DOM.So i think it is problem with the line of Creating DOM.Please help me out.Its very urgent.I have delivery in 2 days.
var temp = xfa.resolveNode("$data.nodes.item(0)");
var test = temp.saveXML();
// Now create the DOM:
var x = XML.parse(test);
var policy = x.resolveNodes("policies");
var number = policy.item(0);
var company = number.getElement("CNACompany").value;
var temp = xfa.resolveNode("$data.nodes.item(0)");
var test = temp.saveXML();
// Now create the DOM:
var x = XMLData.parse(test,false);
var xPathExpr = "//data/policies/[PolicyNumber='WC 1234567890']";
var number = XMLData.applyXPath(x, xPathExpr);
With this code for creating DOM we are getting some junk value for 'x' as 57.13mm.
Thanks in Advance...
Pavan.Hi,
I'm not familiar with the XML.parse() or XMLData.parse() functions. I can't identify the XML or XMLData objects. They are not declared and they are not XFA objects.
Still, it looks like you need to get and set a form/data value.
Here is an example getting the value of a form field:
Your have the following form:
someText
otherText
Use the SOM expression of the CNACompany field to access its value:
var CNAValue = form1.policies.CNACompany.rawValue;
If the value is not merged in the form, try searching the data DOM instead. For example:
var CNAValue = xfa.record.policies.CNACompany.value;
To set the value of a form field or data value, do as follows:
form1.policies.CNACompany.rawValue = newValue;
xfa.record.policies.CNACompany.value = "newValue";
Note: to get/set a value from the data file use the value property. To get/set a value from a form field, use the rawValue property.
Hope this helps,
Hélène
Adobe Systems Inc.
FYI
The Adobe XML Form Object Model Reference posted on the Developer Center contains several scripting examples in Appendix A.
LiveCycle Developer Center
http://www.adobe.com/devnet/livecycle/designing_forms.html
Adobe XML Form Object Model Reference
http://www.adobe.com/devnet/livecycle/articles/Adobe_XML_Form_Object_Model_Reference.pdf -
Repeated retrieval and parsing of XML file causes IE to display an error message
I have a flash application that makes a HTTP call every 120
seconds to retrieve a xml file. This file is being generated with
fresh data every few minutes or so and pushed to the apache web
root with a unix mv command.
I'm using the standard Flash XML object. The HTTP request is
NOT over SSL (I know there is a bug related to this). Here is the
code to make the retrieval:
xmlData = null;
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = xmlTraverse;
xmlData.load("
http://domain/dir/somefile.xml");
The "xmlTraverse" method was written by my team. There is no
known bug in the parsing logic.
Intermittently and unpredictably, IE will display the
following dialogue box:
"A script in this movie is causing Macromedia Flash Player 8
to run slowly. If it continues to run, your computer may become
unresponive. Do you want to abort the script?"
I originally leaned toward an infinite loop causing this
problem. The timeline jumps back and forth between two frames,
checking in the latter frame if the xml has been loaded and parsed
before allowing execution to move to the next frame. I hardcoded
the loop check to always be false, but this did not produce the
message above (although it pegged my CPU).
The only scenario where I've managed to reproduce the message
above is by making a huge (50 MB) xml file. This consistently
produces the message. But I don't realistically see how our xml
file could ever be over 1 MB.
First, can anyone cite another cause for this message? I'm
starting to lean towards the issue lying in our parsing logic such
as infinite recursion on a badly formed XML file. Second, does
anyone know of a solid xml SAX parsing actionscript utility where
you can assign callbacks to XML nodes? If the problem is in the
parsing, we may have to replace our homegrown solution with
something more robust and proven.Is it a recursive parsing function? I'm not sure about this,
but I think this message pops up when there are more than 256
iterations in a loop (I've read something about this 256 limit,
that will end while loops if they exceed this, but with another
error message... but again, I'm not totally sure about that).
The message is typically for loops, but I don't know when it
fires. Sometimes it appears for really 'small' loops when you're
using the debugger (e.g. a for loop with 100 iterations), so maybe
it is connected to the time a loop is running. You could place some
trace statements in the xmlTraverse method, to see where the
function was when the message occurs, or take the time the function
needs and check if this might be related to the error.
That's all I can come up with, guess there are people here
with more insight to this...
cheers,
blemmo -
Is DocumentBuilder.parse(..) reading the whole XML into memory?
Hello,
I have a quick question about the following code snippet:
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.parse("books.xml");Please have a look at the last line "builder.parse("books.xml");". I would like to use XPath to retrieve some informations of a xml file without having to deserialize the whole file (since the XML file rather big and I need to go through several of them in a loop).
What exactly does the "builder.parse(...)" method? Is it reading the XML file and writing all the content to memory? Or does it only analyze and read the structure of the XML code? Or in other words, is the text of an element "//books/title" in memory after parsing, or not until I really access the "title" node of that XML?
Thanks a lot for your help
Best Regards,
BenHi ,
I did'nt knew how to start a new thread , so i am asking the question here:
===========================================================
I am trying to read a xml file but i am not able to do so properly. I am new to xml .
am trying to read a xml file of the following format in the staf and stax job xml file:
<?xml version="1.0" encoding="utf-8"?>
<operating_system>
<unix_80sp1>
<tests type="quick_sanity_test">
<prerequisitescript>preparequicksanityscript</prerequisitescript>
<acbuildpath>acbuildpath</acbuildpath>
<testsuitscript>test quick sanity script</testsuitscript>
<testdir>quick sanity dir</testdir>
</tests>
<machine_name>u80sp1_L004</machine_name>
<machine_name>u80sp1_L005</machine_name>
<machine_name>xyz.pxy.dxe.cde</machine_name>
<vmware id="155.35.3.55">144.35.3.90</vmware>
<vmware id="155.35.3.56">144.35.3.91</vmware>
</unix_80sp1>
</operating_system>
Here machine_name tag can be n number. I need to read all the machine_name tags in an array , so that i can use them later.
Also i need to read all the vmware tags in an array (both value and attributes) so that i can use them later. The number of vmware tags can again be n numbers.
I am trying to use the following code :
<!-- ******************************************************************* -->
<!-- Following function is used to parse an XML file and return the DOM -->
<!-- document object -->
<!-- ******************************************************************* -->
<function name="parseXML" scope="local">
<function-list-args>
<function-required-arg name="xmlFileName">
Name of file containing XML to be parsed
</function-required-arg>
</function-list-args>
<sequence>
<!-- Parse the XML -->
<script>
factory = DocumentBuilderFactory.newInstance();
factory.setValidating(1)
factory.setIgnoringElementContentWhitespace(0)
builder = factory.newDocumentBuilder()
document = builder.parse(xmlFileName)
</script>
<script>
vmware = None
machine_name = None
# Get the text value for the element with tag name "vmware"
nodeList = document.getElementsByTagName("vmware")
for i in range(nodeList.getLength()):
node = nodeList.item(i)
if node.getNodeType() == Node.ELEMENT_NODE:
children = node.getChildNodes()
for j in range(children.getLength()):
thisChild = children.item(j)
if (thisChild.getNodeType() == Node.TEXT_NODE):
machine_name = thisChild.getNodeValue()
# Get the text value for the element with tag name "machine_name"
nodeList = document.getElementsByTagName("vmware")
for i in range(nodeList.getLength()):
node = nodeList.item(i)
if node.getNodeType() == Node.ELEMENT_NODE:
children = node.getChildNodes()
for j in range(children.getLength()):
thisChild = children.item(j)
if (thisChild.getNodeType() == Node.TEXT_NODE):
machine_name = thisChild.getNodeValue()
</script>
<return>[machine_name,vmware]</return>
</sequence>
</function>
I am able to read only one value for machine_name (u80sp1_L005) and also one value for vmware
i.e 144.35.3.91.
What i want is read all the machine_value tags into a list , so that i can use it later
Also i want to read all the vmware tags attributes into a list and all corresponding values into another list.
what i mean is considering the following:_
<machine_name>u80sp1_L004</machine_name>
<machine_name>u80sp1_L005</machine_name>
<machine_name>xyz.pxy.dxe.cde</machine_name>
<vmware id="155.35.3.55">144.35.3.90</vmware>
<vmware id="155.35.3.56">144.35.3.91</vmware>
read all machine_name tag values into one list (u80sp1_L004,u80sp1_L005,xyz.pxy.dxe.cde)
also all vmware attributes into one list *(155.35.3.55,155.35.3.56).....*and all the vmware values into one list *(144.35.3.90,144.35.3.91)*
Also a good link to understand parsing using doumentbilder factory would be good help.
Regards
Sangram
mail: [email protected] -
Problem in parsing a xml string using dom parser
i want to parse a Xml String using a Dom parser......the parse function in dom parser takes only input stream as argument.......so i made the code as
InputStream inputstream = new StringBufferInputStream(XmlData) ;
InputSource inputSource = new InputSource(inputstream );
but saxexception is coming and also warning called
"java.io.StringBufferInputStream in java.io has been deprecated"
please help me.........i want to parse a Xml String using a Dom
parser......the parse function in dom parser takes
only input stream as argument.......This is not true of the DOM parser in Java 1.4. So you might want to get rid of your old parser and replace it by something more current. Or perhaps you are using 1.4 and you just didn't read all of the API docs. -
Parsing BLOB (CSV file with special characters) into table
Hello everyone,
In my application, user uploads a CSV file (it is stored as BLOB), which is later read and parsed into table. The parsing engine is shown bellow...
The problem is, that it won't read national characters as Ö, Ü etc., they simply dissapear.
Is there any CSV parser that supports national characters? Or, said in other words - is it possible to read BLOB by characters (where characters can be Ö, Ü etc.)?
Regards,
Adam
|
| helper function for csv parsing
|
+-----------------------------------------------*/
FUNCTION hex_to_decimal(p_hex_str in varchar2) return number
--this function is based on one by Connor McDonald
--http://www.jlcomp.demon.co.uk/faq/base_convert.html
is
v_dec number;
v_hex varchar2(16) := '0123456789ABCDEF';
begin
v_dec := 0;
for indx in 1 .. length(p_hex_str) loop
v_dec := v_dec * 16 + instr(v_hex, upper(substr(p_hex_str, indx, 1))) - 1;
end loop;
return v_dec;
end hex_to_decimal;
|
| csv parsing
|
+-----------------------------------------------*/
FUNCTION parse_csv_to_imp_table(in_import_id in number) RETURN boolean IS
PRAGMA autonomous_transaction;
v_blob_data BLOB;
n_blob_len NUMBER;
v_entity_name VARCHAR2(100);
n_skip_rows INTEGER;
n_columns INTEGER;
n_col INTEGER := 0;
n_position NUMBER;
v_raw_chunk RAW(10000);
v_char CHAR(1);
c_chunk_len number := 1;
v_line VARCHAR2(32767) := NULL;
n_rows number := 0;
n_temp number;
BEGIN
-- shortened
n_blob_len := dbms_lob.getlength(v_blob_data);
n_position := 1;
-- Read and convert binary to char
WHILE (n_position <= n_blob_len) LOOP
v_raw_chunk := dbms_lob.substr(v_blob_data, c_chunk_len, n_position);
v_char := chr(hex_to_decimal(rawtohex(v_raw_chunk)));
n_temp := ascii(v_char);
n_position := n_position + c_chunk_len;
-- When a whole line is retrieved
IF v_char = CHR(10) THEN
n_rows := n_rows + 1;
if n_rows > n_skip_rows then
-- Shortened
-- Perform some action with the line (store into table etc.)
end if;
-- Clear out
v_line := NULL;
n_col := 0;
ELSIF v_char != chr(10) and v_char != chr(13) THEN
v_line := v_line || v_char;
if v_char = ';' then
n_col := n_col+1;
end if;
END IF;
END LOOP;
COMMIT;
return true;
EXCEPTION
-- some exception handling
END;Uploading CSV files into LOB columns and then reading them in PL/SQL: [It’s|http://forums.oracle.com/forums/thread.jspa?messageID=3454184�] Re: Reading a Blob (CSV file) and displaying the contents Re: Associative Array and Blob Number of rows in a clob doncha know.
Anyway, it woudl help if you gave us some basic information: database version and NLS settings would seem particularly relevant here.
Cheers, APC
blog: http://radiofreetooting.blogspot.com -
Regarding E-Recruitment Resume Parsing
Hi,
We are upgrading to E-Recruitment EHP4. In that for the External Candidate, the resume parsing function plays a major role and this can be done using a third party vendor. Can anyone suggest about the vendor for resume parsing or is there anyway that we can bypass this parsing and proceed further.
Thanks and Best Regards,
Vivek.Hi,
I do not know any third party vendor I could recommend to you.
As I understand you want to deactivate this function, don't you?
Go to Technical Settings -> User Interfaces -> Candidate -> Backend Candidate -> Assign Values to Interface Parameters. Remove the X in the entry RSP_IN_UNREG_AWZD.
Regards
Sebastian -
Can somebody tell me the function used to parse a string and how it works? All I want to do is seperate the string 'AG-01' into another string 'AG-' and an int '01'. I have been through numerous resources and have found nothing at all on parsing functions.
This in one way:
String txt = "AG-01";
String first = txt.substring(0,3);
int second = Integer.parseInt(txt.substring(3,5));
%>
First string:<%=first%>
Second int :<%=second%>
Bye
Beck74 -
RSA ACE server SYSLOG collector, Parsing help!
Hi Board.
I am in a very big hurry for developing a RSA ACE collector script. The
already released RSA ACE Collector script is file based and the RSA ACE
server can dump a CSV log report with an interval of a hour as the
fastest possible interval. This is not at all satisfying for the
customer which - due to the latest issue with hacking attacks on EMC's
network both announced in the press and by letter from EMC and to their
customers - is not at all acceptable. They need to have logic for
pattern searches and correlation rules that can respond as close to real
time as possible.
We have with success and without any troubles or big efforts installed
the SNARE agent on the RSA ACE Appliance box. We are receiving the
events from the RSA server correctly (or we are receiving the events as
unsupported events because the events is not parsed correctly, but all
the needed information is there) and I have started development of a new
Collector script based on the Generic Event Collector (Just
doubleclicked on New Collector script in the Ant menu).
So far I have tryed some different approaches. I know that I can totaly
manipulate with the events received from the Source because I can
pre-set values via the protoEvt.map file. Even further have I been able
to set some other values in the Parse function by using the rec2Evt.map
and then hardcode a value to the desired field by using
rec.-input_record_field-.
Therefor I am pretty convinced that I am on the right track.
Now here is my question:
Based on this copy-pasted s_RXBufferString value (IP addresses and
host+domain values changed for protecting the customer):
Code:
Mar 26 05:48:12 192.168.1.100 hostname[tab]MSWinEventLog[tab]4[tab]Application[tab]14765[tab]Sat Mar 26 10:48:12 2011[tab]1011[tab]ACESERVER6.1[tab]Unknown User[tab]N/A[tab]Information[tab]hostname[tab]Devices[tab][tab][tab]Passcode accepted (Login:'jodo'; User Name:'Doe, John'; Token:'000123456789'; Group:''; Site:''; Agent Host:'remotehost.domain.com'; Server:'serverhost').[tab]14617
*NB!* Swap out [tab] with tablulator delimiter!
I have tryed this approach (this is the entire Parse Functiomn):
Code:
var ValueArray = this.s_RXBufferString.split("\\t");
rec.msg = this.s_RXBufferString;
var SourceInfo = ValueArray[0];
rec.sun = ValueArray[1];
//e.InitServiceName = ValueArray[1];
//rec.Service = ValueArray[1];
//e.EventTime = ValueArray[5];
//rec.EvtTime = ValueArray[5];
//e.VendorEventCode = ValueArray[6];
rec.evtCode = ValueArray[6];
e.DeviceName = ValueArray[7];
rec.sun = ValueArray[8];
//e.EffectiveUserID = ValueArray[8];
//var OSInitUser = ValueArray[8];
//e.InitHostName = ValueArray[11];
rec.shd = ValueArray[11];
//ValueArray[12] = ValueArray[12].ltrim();
var AppSpecificMessage = '';
for(var t = 12; t<count(ValueArray); t+1)
AppSpecificMessage += ValueArray[t];
//e.InitIP = SourceInfo.match("[0-9]+.[0-9]+.[0-9].[0-9]");
rec.sip = this.s_RXBufferString.match("\d+\.\d+\.\d+\.\d+");
var A = AppSpecificMessage.search('\(.+\)');
//e.EventName = 'Debugging RSA';
//e.EventName = AppSpecificMessage.substring(0,A-1).ltrim();
rec.evt = AppSpecificMessage.substring(0,A-1).ltrim();
AppSpecificMessage = AppSpecificMessage.match('\(.+\)');
// var B = AppSpecificMessage.search(')');
//var B = AppSpecificMessage.search(')');
// var BaseInfo = AppSpecificMessage.substring(A+1,B-1);
// var BaseTmpArray = BaseInfo.split(';');
// var BaseArray = new Array();
/*for(var i = 0; i<count(BaseTmpArray); i+1)
var str = BaseTmpArray[i].ltrim();
var TempAr = str.split(':');
BaseArray.push(TempAr[1].substring(1,-1));
/*var AgentArr = BaseArray[6].split(".");
AgentArr.reverse();
AgentArr.pop();
AgentArr.reverse();
e.InitHostDomain = AgentArr.join(".");
//rec.InitDomain = AgentArr.join(".");
e.InitHostDomain = "corp.ad.local";
if (ValueArray[10] == "Information")
rec.sev = "0";
//e.Severity = "0";
else if (ValueArray[10] == "Warning")
rec.sev = "3";
//e.Severity = "3";
else if (ValueArray[10] == "Error")
rec.sev = "4"
//e.Severity = "4";
else
rec.sev = "1";
//e.Severity = "1";
//e.InitUserID = BaseArray[0];
rec.LoginName = BaseArray[0];
//e.InitUserName = BaseArray[1];
rec.UserName = BaseArray[1];
//e.customerVar35 = BaseArray[2];
//rec.Token = BaseArray[2];
//e.customerVar36 = BaseArray[5];
//rec.Agent = BaseArray[5];
instance.SEND_EVENT = true;
// parsing logic goes here
/*if (1==1) { // set SEND_EVENT to true if your parsing logic worked correctly
instance.SEND_EVENT = true;
// If you can't parse...
//rec.sendUnsupported();
return true;
But it just laughs at me and wont work. It states that there is a
parsing error: match function something with input.
Can you please help me build a logic that will work as intended? It
should be clear what information or which piece of the text that I try
map to which Event fields (look at the outcommented bits right above or
below the ones that point to a rec.something because there I have tryed
just map the information directly).
kkrasmussen
kkrasmussen's Profile: http://forums.novell.com/member.php?userid=20966
View this thread: http://forums.novell.com/showthread.php?t=435715> - I'm not sure I understand why you replace the tabs with '|' just to do
> the split; why can't you just split on tab? You can also investigate our
> 'safesplit()' method, which understands quoted delimited strings:
> Novell Login
> (not sure that's necessary in this case)
I replaced the tabs with '|' foir easier regex searchess for both
numbers, alphanummeric and spaces in same match cases - but with the
opportunity to index better for those searches because I did not need to
worry about the tabs being recognised as whitespaces anymore.
The safesplit works fine with '|' but not for this one:
Code:
var AppSpecificArray = AppSpecificMessage.safesplit(";");
It reports that: "Cannot find function safesplit".
If I change that to:
Code:
var AppSpecificArray = AppSpecificMessage.split(/\;/);
It reports that: "Cannot find function split".
> - The 'substring()' method is defined as taking two arguments:
> from Required. The index where to start the extraction. First character
> is at index 0
> to Optional. The index where to stop the extraction. If omitted, it
> extracts the rest of the string
> Neither of those two arguments will *ever* be negative - they always
> count from the beginning of the string. What you're really trying to do
> is to extract the substring from the beginning +1 character, to the end
> -2 characters, which is not how substring() works. But you *can* do
> something like:
> this.evt = Msg.substring(1,Msg.length - 2);
>
Aha I see. Thanks for the info. However, I tried the suggested this.evt
= Msg.substring(1,Msg.length - 2); but it reports: Cannot call method
"substring" of null. Remember that I have already testet and verified
that I do have a value in the Msg variable.
Here is the newest code. Please notice that I have outcommented the
desired "result" and is just trying to get something from at least the
part of the string that I want to parse.
Code:
this.msg = this.s_raw_message2;
var TempTxt = this.s_raw_message2.replace(/\t/g,"|");
var ValueArray = TempTxt.safesplit("|");
var SourceInfo = ValueArray[0];
this.evtCode = ValueArray[6];
this.sip = TempTxt.match(/\d+\.\d+\.\d+\.\d+/);
e.DeviceName = ValueArray[7];
//AppSpecificMessage = TempTxt.match(/(?:\().+(?:\))/);
var Msg = ValueArray[14].match(/(?:\|)[^\|]+(?:\()/);
this.evt = Msg.substring(1,Msg.length - 2);
//this.evt = Msg;
AppSpecificMessage = ValueArray[14].match(/(?:\().+(?:\))/);
if (ValueArray[10] == "Information")
this.sev = "0";
else if (ValueArray[10] == "Warning")
this.sev = "3";
else if (ValueArray[10] == "Error")
this.sev = "4"
else
this.sev = "1";
if(TempTxt.match(/(?:Login:\')\S+(?:')/) != false)
//var apptemp = AppSpecificMessage.substring(1,AppSpecificMessage. length - 1);
//var AppSpecificArray = apptemp.safesplit(";");
var AppSpecificArray = AppSpecificMessage.safesplit(";");
for(var c = 0; c<count(AppSpecificArray); c + 1)
var key = AppSpecificArray[c].split(/:/);
if (key[0] == "(Login")
if (key[1] == "''")
this.iuid = ValueArray[8];
else
this.iuid = key[1];
//this.iuid = key[1].substring(1,key[1].length - 1);
if (key[0] == " User Name")
if (key[1] == "''")
this.sun = "System";
else
this.sun = key[1];
//this.sun = key[1].substring(1,key[1].length - 1);
if (key[0] == " Agent Host")
if (key[1] == "'')")
this.shd = "Unknown Host Domain";
else
//var TempArr = key[1].substring(1,key[1].length - 1).safesplit(".");
var TempArr = key[1].plit(/\./);
TempArr.reverse();
TempArr.pop();
TempArr.reverse();
this.shd = TempArr.join(".");
if (key[0] == " Token")
if (key[1] != "''")
e.CustomerVar35 = key[1];
//e.CustomerVar35 = key[1].substring(1,key[1].length - 1);
else
this.shd = "Unknown Host Domain";
this.iuid = ValueArray[8];
this.sun = "System";
instance.SEND_EVENT = true;
return true;
kkrasmussen
kkrasmussen's Profile: http://forums.novell.com/member.php?userid=20966
View this thread: http://forums.novell.com/showthread.php?t=435715 -
Parsing failed: TypeError: Cannot call method "replace"
Hi,
when i troubleshooting my collector, sentinel GUI message prompt
following:
Parsing failed: TypeError: Cannot call method "replace" of undefined;
input:
my release.js is following:
Collector.prototype.initialize = function() {
this.PARSER.getOffsetData = function(input) {
if (typeof input.RXMap != "undefined") {
return input.RXMap.REQUEST_TM;
conn.addParser(this.PARSER.getOffsetData);
return true;
Collector.prototype.cleanup = function() {
return true;
Connector.prototype.sendQuery = function() {
return true;
Record.prototype.preParse = function(e) {
if (this.CONNECTION_ERROR != null || typeof this.RXMap == "undefined")
{ return false; }
if (this.CONNECTION_METHOD == "DATABASE") {
for (var field in this.RXMap) {
this[field] = this.RXMap[field];
return true;
Record.prototype.parse = function(e) {
var detstring =
this.RXMap.REQUEST_TM.replace(/(\d+)\/(\d+)\/(\d{4})\s(\S+)/g, '$1/$2/$3
$4 GMT');
var dt = new Date(detstring);
e.ObserverEventTime(dt);
return true;
Record.prototype.normalize = function(e) {
instance.SEND_EVENT =true;
return true;
Record.prototype.postParse = function(e) {
return true;
Record.prototype.reply = function(e) {
return true;
my sqlquery.base is following:
SELECT TOP 100 * FROM TS_QUERYBILLSIGNED_LOG WHERE REQUEST_TM > %s
My table sample is following:
CUSTCODE,BEGIN_TM,END_TM,PAGEINDEX,QUERYTYPE,SYSTE MNAME,SIGNEDTYPE,CLIENTIP,CLIENTMAC,CLIENTNAME,MET HODNAME,REQUEST_TM,ANSWER_TM,ANSWER_TOTAL,ANSWER_C URRENTCOUNT,LOG_ID,WAYBILL_NOS
8710294837,12/30/2013,1/2/2014
23:59,0,0,CSS-CLIENT,0,221.213.26.241,6C-F0-49-CD-2C-CD,a0af75ce888346e,waybillSingedTotal,1/3/2014
14:50,1/3/2014 14:50,28,4,433676211,
My table Schema is following:
USE [sfere]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[ts_querybillsigned_log](
[CUSTCODE] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[BEGIN_TM] [datetime] NULL,
[END_TM] [datetime] NULL,
[PAGEINDEX] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[QUERYTYPE] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[SYSTEMNAME] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[SIGNEDTYPE] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CLIENTIP] [varchar](200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CLIENTMAC] [varchar](200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CLIENTNAME] [varchar](500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[METHODNAME] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[REQUEST_TM] [datetime] NULL,
[ANSWER_TM] [datetime] NULL,
[ANSWER_TOTAL] [numeric](20, 0) NULL,
[ANSWER_CURRENTCOUNT] [numeric](20, 0) NULL,
[LOG_ID] [numeric](30, 0) NOT NULL,
[WAYBILL_NOS] [varchar](400) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
Thanks
Best Regards!
Steve zeng
steve_zeng
steve_zeng's Profile: https://forums.netiq.com/member.php?userid=3875
View this thread: https://forums.netiq.com/showthread.php?t=50290steve_zeng;242145 Wrote:
> Hi,
>
> when i troubleshooting my collector, sentinel GUI message prompt
> following:
>
>
> Parsing failed: TypeError: Cannot call method "replace" of undefined;
> input:
>
> my release.js is following:
> ----------------------------------------------------------------------
> Collector.prototype.initialize = function() {
> this.PARSER.getOffsetData = function(input) {
> if (typeof input.RXMap != "undefined") {
> return input.RXMap.REQUEST_TM;
> }
> };
> conn.addParser(this.PARSER.getOffsetData);
> return true;
> };
>
> Collector.prototype.cleanup = function() {
> return true;
> };
>
>
> Connector.prototype.sendQuery = function() {
> return true;
> };
>
>
> Record.prototype.preParse = function(e) {
> if (this.CONNECTION_ERROR != null || typeof this.RXMap == "undefined")
> { return false; }
>
> if (this.CONNECTION_METHOD == "DATABASE") {
>
> for (var field in this.RXMap) {
> this[field] = this.RXMap[field];
> }
> }
>
> return true;
> };
>
> Record.prototype.parse = function(e) {
>
> var detstring =
> this.RXMap.REQUEST_TM.replace(/(\d+)\/(\d+)\/(\d{4})\s(\S+)/g, '$1/$2/$3
> $4 GMT');
> var dt = new Date(detstring);
> e.ObserverEventTime(dt);
> return true;
> };
>
>
> Record.prototype.normalize = function(e) {
> instance.SEND_EVENT =true;
> return true;
> };
>
> Record.prototype.postParse = function(e) {
> return true;
> };
>
>
> Record.prototype.reply = function(e) {
> return true;
>
> ----------------------------------------------------------------------------
> my sqlquery.base is following:
>
> SELECT TOP 100 * FROM TS_QUERYBILLSIGNED_LOG WHERE REQUEST_TM > %s
>
>
> My table sample is following:
> ----------------------------------------------------------------------------------
>
> CUSTCODE,BEGIN_TM,END_TM,PAGEINDEX,QUERYTYPE,SYSTE MNAME,SIGNEDTYPE,CLIENTIP,CLIENTMAC,CLIENTNAME,MET HODNAME,REQUEST_TM,ANSWER_TM,ANSWER_TOTAL,ANSWER_C URRENTCOUNT,LOG_ID,WAYBILL_NOS
> 8710294837,12/30/2013,1/2/2014
> 23:59,0,0,CSS-CLIENT,0,221.213.26.241,6C-F0-49-CD-2C-CD,a0af75ce888346e,waybillSingedTotal,1/3/2014
> 14:50,1/3/2014 14:50,28,4,433676211,
>
> -----------------------------------------------------------------------------------------
> My table Schema is following:
>
> USE [sfere]
> GO
>
> SET ANSI_NULLS ON
> GO
> SET QUOTED_IDENTIFIER ON
> GO
> SET ANSI_PADDING ON
> GO
> CREATE TABLE [dbo].[ts_querybillsigned_log](
> [CUSTCODE] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
> [BEGIN_TM] [datetime] NULL,
> [END_TM] [datetime] NULL,
> [PAGEINDEX] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
> [QUERYTYPE] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
> [SYSTEMNAME] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
> [SIGNEDTYPE] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
> [CLIENTIP] [varchar](200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
> [CLIENTMAC] [varchar](200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
> [CLIENTNAME] [varchar](500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
> [METHODNAME] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
> [REQUEST_TM] [datetime] NULL,
> [ANSWER_TM] [datetime] NULL,
> [ANSWER_TOTAL] [numeric](20, 0) NULL,
> [ANSWER_CURRENTCOUNT] [numeric](20, 0) NULL,
> [LOG_ID] [numeric](30, 0) NOT NULL,
> [WAYBILL_NOS] [varchar](400) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
> ) ON [PRIMARY]
>
> GO
> SET ANSI_PADDING OFF
>
> Thanks
> Best Regards!
> Steve zeng
It's throwing an exception because at some point, you are not checking
your string for nulls before calling replace. My guess is that
this.RXMap.REQUEST_TM is sometimes empty/null and when you call replace,
it then excepts. Always ensure that your string value is
non-null/defined before calling a function against it.
brandon.langley
brandon.langley's Profile: https://forums.netiq.com/member.php?userid=350
View this thread: https://forums.netiq.com/showthread.php?t=50290 -
DateFormat.parse() reads 12:00:00 as 00:00:00?
Hi, i have a method, which uses DateFormat.parse() function, and i want to check whether a date and time input is valid. as you can see from the following code; i have defined the format as (dd-mm-yyyy at hh:mm:ss). the problem is, if i pass a string as (dd-mm-yyyy at 12:21:23), the method changes hour field to '00'. i.e., the line denoted as LINE N in the code prints out 'dd-mm-yyyy at 00:21:23'. i have tested other hours and they are all fine, 00 is interpreted as 00, 24 is 00 which is fine, but 12 is also parsed to 00.... any way to change this please?
Many thanks!
public boolean isValidDate(String dt)
boolean isValid=false;
DateFormat datef=new SimpleDateFormat("dd-MM-yyyy 'at' hh:mm:ss",Locale.UK);
java.util.Date d = new java.util.Date();
try{
d=datef.parse(dt);
////////////////////// LINE N //////////////////////////////////////////
System.out.println("is this right"+d.toString());
///////////////////// LINE N //////////////////////////////////////////
int hr = d.getHours();
System.out.println("This is the hour "+hr);
if(hr<=18&&hr>=9)
isValid=true;
System.out.println("hour ok");
else{System.out.println("hour not ok");}
catch(ParseException pe)
isValid=false;
return isValid;
}use gregoriancalendar instead
-->
http://java.sun.com/j2se/1.4.2/docs/api/java/util/Greg
orianCalendar.htmlTrue.
@OP. You should never call getHours() on a date object, you should always use a Calendar.
Kaj -
Problem with SimpleDateFormat.parse()
Hello
I have a problem with the parse-function in SimpleDateFormat.
When i try to parse the date Fri Jul 15 17:23:41 2005 with this pattern EEE MMM d HH:mm:ss yyyy i get the exception java.text.ParseException: Unparseable date: "Fri Jul 15 17:23:41 2005".
This is my code:
SimpleDateFormat df=new SimpleDateFormat("EEE MMM d HH:mm:ss yyyy");
try {
df.parse(strDate);
} catch (ParseException e) {
e.printStackTrace();
}Can someone explain me what i did wrong?
Thanks
MatthiasSince your name is "Matthias" it is possible that your locale is one that does not use the English language. If that is the case then your problem is that "Fri" or "Jul" are not correct abbreviations in your language.
Easiest way to test this idea is to format a date (such as now) using that SimpleDateFormat object and see what the output looks like. -
APD failure due to MDX Parser starting issue
Hello,
As part of BW on HANA migration, we have recently migrated Dev system to HANA database and during testing we have issue for one of the APD's
which when triggered failed with the below error messages: Error occurred when starting the parser:timeout during allocate / CPIC- CALL: 'ThSAPCMRCV' Syntax error in MDX statement Termination: Error when executing the query Processing was canceled And the RFC connection for MDX PARSER was also failing. Subsequently, basis implemented the SAP Note 1032461 - MDX parser does not start. Which resolved the issue with the RFC connection. However, the APD is still failing. The error message we get is as below for the same: Error occurred when starting the parser: Function RRTS_PARSE_MDX is not available Syntax error in MDX statement Termination: Error when executing the query Processing was canceled. Request your help on the same.
Most of the SDN forums on this topic advised on the SAP Note 1032461. However, despite implementing the same note our basis team couldn't succeed in resolving the issue. Thank you!Hi Meduru Avinash,
As you rightly told, most of the time note 1032461 is referred to solve this issue.
Some where I have read that we need to refer 638701 also,
like adding gw/cpic_timeout in your system, if it is not available.
BR
Prabhith -
Parsing a time field with SimpleDateFormat
Our users can not key in a military time, they must key in a time with the ampm designation. We allow a for am, p for pm, m for midnight and n for noon. (Don't ask-I guess they don't understand 12:00pm or 12:00am so they specify 12:00m for midnight and 12:00n for noon.)
I want to use the parse function, with lenient set to false to validate that they keyed a valid date. This works fine when they key a or p behind the date. If they key m or n, it gives an error. I tried using DateFormatSymbols to allow a,p,m or n for the AmPmStrings. This works fine if lenient is set to true. With lenient set to false, it still gives me an invalid date. I guess it is not recognizing my DateFormatSymbol.
Not sure if I am going about this the wrong way or if there is an easier way to validate the time. I just thought the parse would be a cleaner way then to substring out the hours and minutes, then validate that they are valid numbers.
Below is the code I was using. Can anyone explain why this won't work?
DateFormatSymbols symbols = new DateFormatSymbols();
String[] ampm = new String[4];
ampm[0] = new String("A");
ampm[1] = new String("P");
ampm[2] = new String("M");
ampm[3] = new String("N");
symbols.setAmPmStrings(ampm);
SimpleDateFormat df = new SimpleDateFormat("hhmma", symbols);
df.setLenient(false);
try
parsedTime = df.parse(time.toUpperCase());
return true;
catch (ParseException e)
errorMessages.add("Invalid Date.");
return false;
}Well, this isn't gonna help you, but-
I can't say unequivocally(sp) that this is the case, but after a bit of poking about, it appears that the DateFormatSymbols.setAmPmStrings method ignores everything but the first two entries in the string. That is, if you use
ampm[0] = new String("M");
ampm[1] = new String("N");
ampm[2] = new String("A");
ampm[3] = new String("P");You will be able to parse M's and N's, but not A's and P's.
Not sure if that helps you, but there you go.
Lee
Maybe you are looking for
-
Need urgent help with update!
hi i tried to update my ipod vid to software v1.2 from itunes and i get a message saying 'The ipod could not be updated. an unknown error occured (1417)' so i figured if i restored my ipod that would fix the problem, well i cant seem to restore it ei
-
i am wondering if anyone can tell me how to go about getting a refund on my account with itunes for apps i have been billed twice for. this has happened befor and u used to be able to gointo purchases and report a problem and they would take care of
-
Hi All, How to place currencysymbole '£' (GBP) in the smartform before the Amount. This is very urgent.Please anybody help me. I will reward you points.
-
Can I use the iPhone 5s unlocked model A1533 for LG U in South Korea
Can I use the iPhone 5s unlocked model A1533 for LG U in South Korea
-
"Send to Color" Not appearing.
When I installed Final Cut Studio, I opted to not install Color to save space on my computer; I had no need for it at the time. Since then, I have installed Color (I did not reinstall Final Cut Pro), but when I right click on a clip in my sequence, t