XML stream and stored as an output XML file

Dear ALL,
Could you help me in such situation?
I need create XML file. I have DTD file. I create XML stream and stored as an output XML file. But all the data of my XML file stored in one line.
How I can create my XML file according to DTD file?
Thanks a lot.
Best regards,
Igor

hi
good
go through this links,hope these would help you to solve your problem
http://rustemsoft.com/JSPsample.htm
http://publib.boulder.ibm.com/infocenter/wsphelp/index.jsp?topic=/com.ibm.etools.xmlbuilder.doc/tasks/txmltask.htm
thanks
mrutyun^

Similar Messages

  • Create XML stream and stored as an output XML file

    Dear ALL,
    Could you help me in such situation?
    I need create XML file. I have DTD file. I create XML stream and stored as an output XML file. But all the data of my XML file stored in one line.
    How I can create my XML file according to DTD file?
    Thanks a lot.
    Best regards,
    Igor

    hi
    good
    go through this links,hope these would help you to solve your problem
    http://rustemsoft.com/JSPsample.htm
    http://publib.boulder.ibm.com/infocenter/wsphelp/index.jsp?topic=/com.ibm.etools.xmlbuilder.doc/tasks/txmltask.htm
    thanks
    mrutyun^

  • [svn] 1179: - added setup and storing settings in a separate file to facilitate updates .

    Revision: 1179
    Author: [email protected]
    Date: 2008-04-10 11:58:03 -0700 (Thu, 10 Apr 2008)
    Log Message:
    - added setup and storing settings in a separate file to facilitate updates.
    - fixed support for paths with spaces (i.e diffpack pack "c:/my documents/egeorgie/package")
    - fixed to handle relative paths in the arguments
    - fixed to create and include a .patch file in the package
    - added readme.txt
    Modified Paths:
    flex/sdk/trunk/tools/diffpack/src/diffpack.mxml
    Added Paths:
    flex/sdk/trunk/tools/diffpack/diffpack
    flex/sdk/trunk/tools/diffpack/diffpack.air
    flex/sdk/trunk/tools/diffpack/readme.txt
    Removed Paths:
    flex/sdk/trunk/tools/diffpack/src/diffpack

    Revision: 1179
    Author: [email protected]
    Date: 2008-04-10 11:58:03 -0700 (Thu, 10 Apr 2008)
    Log Message:
    - added setup and storing settings in a separate file to facilitate updates.
    - fixed support for paths with spaces (i.e diffpack pack "c:/my documents/egeorgie/package")
    - fixed to handle relative paths in the arguments
    - fixed to create and include a .patch file in the package
    - added readme.txt
    Modified Paths:
    flex/sdk/trunk/tools/diffpack/src/diffpack.mxml
    Added Paths:
    flex/sdk/trunk/tools/diffpack/diffpack
    flex/sdk/trunk/tools/diffpack/diffpack.air
    flex/sdk/trunk/tools/diffpack/readme.txt
    Removed Paths:
    flex/sdk/trunk/tools/diffpack/src/diffpack

  • Strange behavior when getting data and storing it into a tdms file

    Hi
    I am getting data from a VISA device(10bytes every 20ms) in a string buffer and then using indexing array get each element which is 2 bytes , filtering the data in real time using a butterworth filter and then storing the data to a TDMS.
    The problem is that the data goes haywire after a brief the the different elemetns just switch. So for example x becomes resistance, GSR becomes  etc
    I have uploaded the VI and the TDMS file converted to excel format

    You really should be writing to the TDMS file while you acquire the data.  By using the Autoindexing Tunnels to build the arrays, you are causing A LOT of memory allocations, which causes things to really slow down.  I would venture to say that you are missing data, causing what looks like a shift in the data.  But you would need to be looking at the error coming out of the VISA Read to know for sure.
    So look into the Producer/Consumer.  The idea is to use a parallel loop to log the data while your current loop reads and processes the data.  The data is sent to the consumer loop via a queue.

  • Fetching all mails in Inbox from Exchange Web Services Managed API and storing them as a .eml files

    I want to fetch all mails in the Inbox folder using EWS Managed API and store them as .eml.
    I can store file once I get the file content as a byte[] will
    not be difficult, as I can do:
    File.WriteAllBytes("c:\\mails\\"+mail.Subject+".eml",content);
    The problem will be to fetch (1) all mails with (2)
    all headers (like from, to, subject) (I am keeping information of those values of from, to and
    other properties somewhere else, so I need them too) and (3)byte[]
    EmailMessage.MimeContent.Content. Actually I am lacking understanding of
    Microsoft.Exchange.WebServices.Data.ItemView,
    Microsoft.Exchange.WebServices.Data.BasePropertySet and
    Microsoft.Exchange.WebServices.Data.ItemSchema
    thats why I am finding it difficult.
    My primary code is:
    When I create PropertySet as
    follows:
    PropertySet properties = new PropertySet(BasePropertySet.FirstClassProperties, ItemSchema.MimeContent);
    I get following exception:
    The property MimeContent can't be used in FindItem requests.
    I dont understand
    (Q1) What these ItemSchema and BasePropertySet are
    (Q2) And how we are supposed to use them
    So I removed ItemSchema.MimeContent:
    PropertySet properties = new PropertySet(BasePropertySet.FirstClassProperties);
    I wrote simple following code to get all mails in inbox:
    ItemView view = new ItemView(50);
    view.PropertySet = properties;
    FindItemsResults<Item> findResults;
    List<EmailMessage> emails = new List<EmailMessage>();
    do
    findResults = service.FindItems(WellKnownFolderName.Inbox, view);
    foreach (var item in findResults.Items)
    emails.Add((EmailMessage)item);
    Console.WriteLine("Loop");
    view.Offset = 50;
    while (findResults.MoreAvailable);
    Above I kept page size of ItemView to
    50, to retrieve no more than 50 mails at a time, and then offsetting it by 50 to get next 50 mails if there are any. However it goes in infinite loop and continuously prints Loop on
    console. So I must be understanding pagesize and offset wrong.
    I want to understand
    (Q3) what pagesize, offset and offsetbasepoint in ItemView constructor
    means
    (Q4) how they behave and
    (Q5) how to use them to retrieve all mails in the inbox
    I didnt found any article online nicely explaining these but just giving code samples. Will appreciate question-wise explanation despite it may turn long.

    1) With FindItems it will only return a subset of Item properties see
    http://msdn.microsoft.com/en-us/library/bb508824(v=exchg.80).aspx for a list and explanation. To get the mime content you need to use a GetItem (or Load) I would suggest you read
    http://blogs.msdn.com/b/exchangedev/archive/2010/03/16/loading-properties-for-multiple-items-with-one-call-to-exchange-web-services.aspx which also covers of paging as well.
    3) offset is from the base your setting the offset to 50 each time which means your only going to get the 50 items from the offset of 50 which just creates an infinite loop. You should use
    view.Offset
    = +50;
    to increment the Offset although it safer to use
    view.Offset  += findResults.Items.Count;
    which increments the offset based on the result of the last FindItems operation.
    5) try something like
    ItemView iv = new ItemView(100, 0);
    FindItemsResults<Item> firesults = null;
    PropertySet psPropSet = new PropertySet(BasePropertySet.IdOnly);
    iv.PropertySet = psPropSet;
    PropertySet itItemPropSet = new PropertySet(BasePropertySet.IdOnly) { ItemSchema.MimeContent, ItemSchema.Subject, EmailMessageSchema.From };
    do
    firesults = service.FindItems(WellKnownFolderName.Inbox, iv);
    service.LoadPropertiesForItems(firesults.Items, itItemPropSet);
    foreach(Item itItem in firesults){
    Object MimeContent = null;
    if(itItem.TryGetProperty(ItemSchema.MimeContent,out MimeContent)){
    Console.WriteLine("Processing : " + itItem.Subject);
    iv.Offset += firesults.Items.Count;
    } while (firesults.MoreAvailable);
    Cheers
    Glen
    .Offset += fiFitems.Items.Count;

  • JTable and storing up-dated in a file

    The first task is to save data entered in the JTable to a file.
    I could not do this as I could not access the updated model.
    I include the three files. At the moment the method tableChanged is stopping the init method loading because it sees this a table changed.
    Any help after a day slogging at this would be most appreciated.
    Yours Sincerely,
    Kieran A. Murray
    package tables;
    import javax.swing.*;
    import javax.swing.event.TableModelEvent;
    import javax.swing.event.TableModelListener;
    import javax.swing.table.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.util.Vector;
    import javax.swing.table.*;
    public class PowerFrame extends JFrame
    private JFrame PowerFrame;
    private JTabbedPane PowerTabPane;
    private JMenuItem fMenuOpen = null;
    private JMenuItem fMenuSave = null;
    private JMenuItem fMenuClose = null;
    JavaFilter fJavaFilter = new JavaFilter ();
    File fFile = new File ("default.dat");
    private Object Vectorin;
    private Object v;
    public Vector q;
    private int count;
    private int xcount;
    private int qcount;
    private int ycount;
    private int pcount;
    private File file;
    BusbarRecords Busbar = new BusbarRecords();
    BusbarsUI ui = new BusbarsUI();
    public PowerFrame () {
         super("Begin at the Beginning");
         addWindowListener(new WindowAdapter()
         { public void windowClosing(WindowEvent e)
         { System.exit(0);
         PowerTabPane = new JTabbedPane(SwingConstants.RIGHT);
         PowerTabPane.setBackground(Color.blue);
         PowerTabPane.setForeground(Color.white);
         populatePowerTabbedPane();
         buildMenu();
         getContentPane().add(PowerTabPane);
    private void populatePowerTabbedPane()
         PowerTabPane.addTab("Busbars", null, new BusbarsUI(), "Data for Busbar");
    private void buildMenu()
         JMenuBar mb = new JMenuBar();
         JMenu menu = new JMenu("File");
         setJMenuBar (mb);
         setSize (400,400);
         JMenuItem openitem = new JMenuItem("Open");
         JMenuItem saveitem = new JMenuItem("Save");
         JMenuItem exititem = new JMenuItem("Exit");
         exititem.addActionListener(new ActionListener()
         public void actionPerformed(ActionEvent e)
         System.exit(0);
         openitem.addActionListener(new ActionListener()
         public void actionPerformed ( ActionEvent e ) {
              boolean status = false;
              status = openFile ();
              if (!status)
              JOptionPane.showMessageDialog (
              null,
              "Error opening file!", "File Save Error",
              JOptionPane.ERROR_MESSAGE);
         saveitem.addActionListener(new ActionListener()
         public void actionPerformed ( ActionEvent e ) {
              boolean status = false;
              status = saveFile ();
              if (!status)
              JOptionPane.showMessageDialog (
              null,
              "Error opening file!", "File Open Error",
              JOptionPane.ERROR_MESSAGE);
         menu.add(openitem);
         menu.add(saveitem);
         menu.add(exititem);
         mb.add(menu);
         setJMenuBar(mb);
         * Use a JFileChooser in Open mode to select files
         * to open. Use a filter for FileFilter subclass to select
         * for *.java files. If a file is selected then read the
         * file and place the string into the textarea.
         boolean openFile () {
         JFileChooser fc = new JFileChooser ();
         fc.setDialogTitle ("Open File");
         // Choose only files, not directories
         fc.setFileSelectionMode ( JFileChooser.FILES_ONLY);
         // Start in current directory
         fc.setCurrentDirectory (new File ("."));
         // Set filter for Java source files.
         fc.setFileFilter (fJavaFilter);
         // Now open chooser
         int result = fc.showOpenDialog (this);
         if (result == JFileChooser.CANCEL_OPTION) {
         return true;
         } else if (result == JFileChooser.APPROVE_OPTION) {
         fFile = fc.getSelectedFile ();
                   // Invoke the readFile method in this class
         q = (Vector) readFile (fFile);
              System.out.println(q.elementAt(1));
         /*ui.readFileIntoJTable(q);*/
         } else {
         return false;
         return true;
         } // openFile
         boolean saveFile () {
              File file = null;
              JFileChooser fc = new JFileChooser ();
              // Start in current directory
              fc.setCurrentDirectory (new File ("."));
              // Set filter for Java source files.
              fc.setFileFilter (fJavaFilter);
              // Set to a default name for save.
              fc.setSelectedFile (fFile);
              // Open chooser dialog
              int result = fc.showSaveDialog (this);
              if (result == JFileChooser.CANCEL_OPTION) {
              return true;
              } else if (result == JFileChooser.APPROVE_OPTION) {
              fFile = fc.getSelectedFile ();
              if (fFile.exists ()) {
              int response = JOptionPane.showConfirmDialog (null,
              "Overwrite existing file?","Confirm Overwrite",
              JOptionPane.OK_CANCEL_OPTION,
              JOptionPane.QUESTION_MESSAGE);
              if (response == JOptionPane.CANCEL_OPTION) return false;
              return ui.getJTableFields(fFile);
              else{
              return false;
              } // saveFile
         public Object readFile (File file) {
              try{
                   FileInputStream fis = new FileInputStream(file);
                   ObjectInputStream ois = new ObjectInputStream(fis);
                   v = ois.readObject();
                   fis.close();
              catch(Exception e){
                   System.err.println("Exception:" + e.getMessage());
              return (v);
    public static void main(String[] args)
         PowerFrame PF = new PowerFrame();
         PF.pack();
         PF.setSize(765,690);
         PF.setBackground(Color.white);
         PF.setVisible(true);
    package tables;
    import javax.swing.JTable;
    import javax.swing.JScrollPane;
    import javax.swing.JPanel;
    import javax.swing.event.TableModelEvent;
    import javax.swing.event.TableModelListener;
    import javax.swing.table.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.util.*;
    public class BusbarsUI extends JPanel implements TableModelListener {
         private boolean DEBUG = true;
    private int xcount;
    private int ycount;
    private int pcount;
    private int qcount;
    private int y;
    private TableModel newmodel;
    JTable table;
         BusbarRecords Busbar=new BusbarRecords();
    public BusbarsUI() {
         init();
    public void init(){
         DefaultTableModel model = new DefaultTableModel();
         model.addTableModelListener( this );
         JTable table = new JTable(model);
         setLayout(new BorderLayout());
         setBackground(Color.white);
         Vector p = Busbar.setJTableFields();
    String[] s = initializevector();
    System.out.println(p.size());
         for (xcount=1; xcount <= Busbar.columnNames.length;xcount++)
              model.addColumn(Busbar.columnNames [xcount-1]);
         for (qcount=1; qcount <= 5; qcount++)
         model.addRow(s);
              pcount=1;
         while (pcount < (p.size()-1))
              for (ycount=1; ycount <= p.size()/5; ycount++)
                   for (xcount=1; xcount <= Busbar.columnNames.length;xcount++)
                        model.setValueAt(p.elementAt(pcount-1), ycount-1, xcount-1);
                        pcount++;
         model.addRow(new Object[]{""});
    for (pcount=0; pcount <= p.size()-1; pcount++)
         System.out.println(p.elementAt(pcount));
    table.setPreferredScrollableViewportSize(table.getPreferredSize());
    JScrollPane scrollPane = new JScrollPane(table);
    add(scrollPane, BorderLayout.CENTER);
    public void tableChanged(TableModelEvent e)
              System.out.println(e.getSource());
              if (e.getType() == TableModelEvent.UPDATE)
                   int row = e.getFirstRow();
                   int column = e.getColumn();
                        TableModel model = table.getModel();
                        model.getValueAt(row,column);
                        Vector g = new Vector();
                        for(int i=0; i < model.getRowCount();i++){
                             for(int j=0;j < model.getColumnCount();j++){
                                  g.addElement(model.getValueAt(i,j));
    private void stopEditing() {
         if (table.getCellEditor() != null)
         table.getCellEditor().stopCellEditing();
    private String[] initializevector()
         String[] v = new String[5];
         for (int i=0; i<5;i++)
              v="";
         return v;
         /* public JTable update()
              for (xcount=1; xcount <= Busbar.columnNames.length;xcount++)
                   for (qcount=1; qcount <= 5; qcount++)
                        System.out.println(model.getValueAt(ycount-1, xcount-1));
              JTable table = new JTable(model);
              return table;
    /* public JTable readFileIntoJTable(Object q)*/
    public boolean getJTableFields(File file)
         Vector g = new Vector();
         stopEditing();
         /*for(int i=0; i < model.getRowCount();i++){
              for(int j=0;j < model.getColumnCount();j++){
                   g.addElement(model.getValueAt(i,j));
         int numRows=model.getRowCount();
         int numCols= model.getColumnCount();
    System.out.println("Value of data: ");
    for (int i=0; i < numRows; i++) {
    System.out.print(" row " + i + ":");
    for (int j=0; j < numCols; j++) {
    System.out.print(" " + table.getValueAt(i, j));
    System.out.println();
    System.out.println("--------------------------");*/
    try
              FileOutputStream fos = new FileOutputStream(file);
              ObjectOutputStream object = new ObjectOutputStream(fos);
              object.writeObject(g);
              object.flush();
              object.close();
         catch(Exception ex)
              System.out.println("Exception:" + ex);
              return false;
              return true;
    package tables;
    import java.io.*;
    import javax.swing.JTable;
    import javax.swing.table.DefaultTableModel;
    import javax.swing.table.TableModel;
    import java.util.Vector;
    public class BusbarRecords implements Serializable
    private String firstName, lastName, sport;
    private int years;
    private boolean vegetarian;
    private int xcount;
    private int ycount;
    private int pcount;
    private int y;
    private PowerFrame PR;
    File file;
    String[] columnNames = {"First Name",
    "Last Name",
    "Sport",
    "# of Years",
    "Vegetarian"};
    Object [][] data = {
    {"Mary", "Campione",
    "Snowboarding", new Integer(5), new Boolean(false)},
    {"Alison", "Huml",
    "Rowing", new Integer(3), new Boolean(true)},
    {"Kathy", "Walrath",
    "Chasing toddlers", new Integer(2), new Boolean(false)},
    {"Mark", "Andrews",
    "Speed reading", new Integer(20), new Boolean(true)},
    {"Angela", "Lih",
    "Teaching high school", new Integer(4), new Boolean(false)}
         public Vector setJTableFields(){
              Vector p = new Vector();
         for (ycount =1; ycount <=5; ycount++)
              for(xcount=1; xcount <= columnNames.length; xcount++)
                   p.add("one");
         return p;
    package tables;
    import javax.swing.*;
    import java.io.*;
    /** Filter to work with JFileChooser to select java file types. **/
    public class JavaFilter extends javax.swing.filechooser.FileFilter
    public boolean accept (File f) {
    return f.getName ().toLowerCase ().endsWith (".java")
    || f.isDirectory ();
    public String getDescription () {
    return "Java files (*.java)";
    } // class JavaFilter

    brilliant thanks Dr Clap thats just what i was looking for - ive been wasting time searching thru thr ROME and Informa API's for a way of doing this before realising that i just need to write the URL's into a file and the read from them !!

  • Parse and output XML document while preserving attribute order

    QUESTION: How can I take in an element with attributes from an XML and output the same element and attributes while preserving the order of those attributes?
    The following code will parse and XML document and generate (practically) unchanged output. However, all attributes are ordered a-z
    Example: The following element
    <work_item_type work_item_db_site="0000000000000000" work_item_db_id="0" work_item_type_code="3" user_tag_ident="Step" name="Work Step" gmt_last_updated="2008-12-31T18:00:00.000000000" last_upd_db_site="0000000000000000" last_upd_db_id="0" rstat_type_code="1">
    </work_item_type>is output as:
    <work_item_type gmt_last_updated="2008-12-31T18:00:00.000000000" last_upd_db_id="0" last_upd_db_site="0000000000000000" name="Work Step" rstat_type_code="1" user_tag_ident="Step" work_item_db_id="0" work_item_db_site="0000000000000000" work_item_type_code="3">
    </work_item_type>As you may notice, there is no difference in these besides order of the attributes!
    I am convened that the problem is not in the stylesheet.xslt but if you are not then it is posted bellow.
    Please, someone help me out with this! I have a feeling the solution is simple
    The following take the XML from source.xml and outputs it to DEST_filename with attributes in a-z order
    Code:
    private void OutputFile(String DEST_filename, String style_filename){
         //StreamSource stylesheet = new StreamSource(style_filename);
         try{
              File dest_file = new File(DEST_filename);
              if(!dest_file.exists())
                  dest_file.createNewFile();
              TransformerFactory tranFactory = TransformerFactory.newInstance();
              Transformer aTransformer = tranFactory.newTransformer();
              aTransformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
              Source src = new DOMSource("source.xml");
              Result dest = new StreamResult(dest_file);
              aTransformer.transform(src, dest);
              System.out.println("Finished");
         catch(Exception e){
              System.err.print(e);
              System.exit(-1);
        }

    You can't. The reason is, the XML Recommendation explicitly says the order of attributes is not significant. Therefore conforming XML serializers won't treat it as if it were significant.
    If you have an environment where you think that the order of attributes is significant, your first step should be to reconsider. Possibly it isn't really significant and you are over-reaching in some way. Or possibly someone writing requirements is ignorant of this fact and the requirement can be discarded.
    Or possibly your output is being given to somebody else who has a defective parser which expects the attributes to be in a particular order. You could quote the XML Recommendation to those people but often XML bozos are resistant to change. If you're stuck writing for that parser then you'll have to apply some non-XML processing to your output to fix it up on their behalf.

  • JAXP 1.4 in JDK 1.5? javax.xml.stream.FactoryFinder$ConfigurationError

    hello,
    i'm forced to develop in jdk 1.5 and need to use package javax.xml.stream (StAX), which is not included in jaxp1.3 (in jdk 5), so there is a need to somehow integrate jaxp 1.4 to jdk5.
    first thing i've tried was getting jaxp 1.4 src and include a buildpath to my project to it. problem is, that javax.xml.stream.XMLOutputFactory.newInstance() throws exception javax.xml.stream.FactoryFinder$ConfigurationError: Provider com.sun.xml.internal.stream.XMLOutputFactoryImpl not found
    thanks in advance

    problem solved

  • Which data file format is better for storing setup information? XML, ASCII or Binary?

    Hello,
    Our application is using cluster, string, Integer and other data types and storing them in ASCII files.  We are using flatten to string function and storing it to the text file.  However, going ahead we want to migrate to XML file format.  Is it a good idea?  What would be the pros and cons?
    Thanks.

    If you are using LabVIEW's Flatten to String function, you are storing your data as binary, even if you are sending a string to the file writer.
    The issues you will run into using this method or any of the canned LabVIEW XML VIs:  If your data type changes, your files can't be read in any more.  You mentioned you have clusters.  If you add an element or take one away, the old files won't be read in anymore.  You would have to store old versions of the data type and file reader and then convert the old data type to the new data type.
    The nice thing about OpenG's INI functions is they take variant's, so you can pass complex data structures and it will write the file.  If the data type changes, as long as it can be coerced into the format, it will still be read in.  If you pass a cluster and a value is missing from the INI, the default is used.  If there is an extra value in the INI, it's just skipped.  So, your reader and writers can be updated without as much concern about supporting old data files.
    One method you can do if you want to use binary is the "TLD" method.  TLD stands for Type, Length, Data.  I use an enum for the Type.  The Length is just the length of the Data which follows, and then the data is the binary data.  If I change a data type, then I create a new enum value (always has to be added to the end of the list to maintain value consistency with the old files).  This way, the reader can still handle the old data type and convert it into the new data type in whatever method is necessary.  It can also completely ignore it if desired.  I usually process clusters as individual items so I don't have to save old versions of the cluster.  It works quite well and only adds a few bytes per data item.  The big caveat is you have to remember to update your file writer and reader whenever you change a datatype or add a new value.

  • Java objects to xml streams in pipe

    hi all
    I am stuck up at a point in my project.I want to write and read a java object ie Record record , in to a pipe.Not the record object has the data that i reads from a text file.I want the data written in the pipe in the from of xml stream and that read from the pipe in the xml stream .can anyone suggest me with some concerete solution
    thanking you
    yash

    XMLBeans and JAXB technologies convert Java Objects to XML.

  • XML Export and Import

    Hi
         I knew that BW  metadata can be trasformed using XML Using export and Imoport but how to make selection of set of  BW objects through metadata export and import in XML format.
         For example i would like to export some 10 infoobjects to the PC WORK Station and would like to Import  the same XML file to another BW system.
    Thanks in advance.

    Hi,
    You can do it from RSA1 -> Transport Connection.
    Under XML->Export, choose "InfoObjects by Application components". Then select the ones that you need to export and drag on the right pane.
    Once you finish collecting all the InfoObjects, click on the "Export as XML" button and it will generate the XML.
    Hope this helps.

  • How to make the result showing one time and make the result to csv file?

    My script having problem of showing out all the AD computer name result  from Active Directory once when running it and storing the result to csv file. I am a newbie in AD and powershell.
    This is the code:
    $strADPathFile = "D:\Powershell for AD\ADPathList.txt"
    $strErrLogFile = "D:\powershell for AD\errorADComputer.log"
    $arrADPath = Get-Content -Path $strADPathFile
    foreach ($strADPath in $arrADPath)
    try
    $objSearch = New-Object DirectoryServices.DirectorySearcher
    $objSearch.Filter = '(objectCategory=computer)'
    $objSearch.SearchRoot = $strADPath
    $objSearch.SearchScope = "Subtree"
    $objSearch.PageSize = 1000
    $objResults = $objSearch.Findall()
    write-host "Retrieving AD computer information in the domain $strDomain"
    write-host "Number of AD Computer Name result: "$objResults.Count
    foreach($objResult in $objResults){
    $objComputer = $objResult.GetDirectoryEntry()
    write-host $objComputer.dNSHostName
    try
    # InsertSQLTable $objComputer
    catch
    write-host $error[0]
    $strError = $objComputer.dNSHostName + " " + $dateNow + $error[0]
    Add-Content $strErrLogFile $strError
    catch
    write-host $error[0]
    Export-Csv D:\PowerShellforAD\test2.csv
    This is the error that I had get is that it will get the result for 2nd time again.
    By the way, what is InputObject about? I had research some of it and still did not quite get it. Can anyone explain? Thanks 

    Hi,
    in the final line you call Export-Csv. which is a great command at exporting information. However, for it to work it needs a path to export to (D:\PowerShellforAD\test2.csv in your case) and Information (InputObject) to export.
    You do not give that command any Information, so it throws an error.
    Cheers,
    Fred
    There's no place like 127.0.0.1

  • Is it possible to create a Webservice in BI which takes XML as an input and gives PDF as output with an additional requirement that Siebel expecting the XSD from BI to send data in the BI requested format

    Is it possible to create a Webservice in BI which takes XML as an input and gives PDF as output with an additional requirement that Siebel expecting the XSD from BI to send data in the BI requested format. Siebel wants to send the data as xml to BI but not sure of the BI capabilities on giving WSDL embedded with XSD (input is a hierarchical)

    Hi All,
    I am able to fulfil above requirement. Now I am stuck at below point. Need your help!
    Is there any way to UPDATE the XML file attached to a Data Definition (XML Publisher > Data Definition) using a standard package or procedure call or may be an API from backend? I am creating an XML dynamically and I want to attach it to its Data Definition programmatically using SQL.
    Please let me know if there is any oracle functionality to do this.
    If not, please let me know the standard directories on application/database server where the XML files attached to Data Definitions are stored.
    For eg, /$APPL_TOP/ar/1.0/sql or something.
    Regards,
    Swapnil K.

  • XSLT Generation from input and output XML

    Is it possible to generate an XSL mapping file in Java if we have input and output XML.
    If yes, then how to achieve this when user defined functions are used during mapping?

    Hi Prateek,
    check the following links for Business connectors and adapter:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/92/3bc0401b778031e10000000a1550b0/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/2c/4fb240ac052817e10000000a1550b0/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/6a/3f93404f673028e10000000a1550b0/frameset.htm
    Hope these help you.
    Regards,
    Anuradha.B

  • Generating a XML file and Storing on the Presentation Server

    Hi Experts,
    I am facing a problem in generating and storing a XML file on Presentation Server.
    I am using Call Transformation as follows:
    CALL TRANSFORMATION id
    SOURCE para = t_xml[]
    RESULT XML xml_string.
    APPEND xml_string TO xml_tab.
    and then using GUID_DOWNLOAD to store the xml file on the PS.
    DATA: xml_string type string,
              xml_tab type table of string.
    now on using GUI_DOWNLOAD, i get the runtime error as Illegal Type Casting.
    On the other hand if i give the data declaration as follows, the code works fine.
    TYPES: begin of ttab,
                       line(65535) type c,
                 end of ttab.
    DATA: xml_string type string,
              xml_tab type table of ttab.
    SInce my data in INternal Table can be very large, 65535 characters are not sufficient for me.
    How do i solve this problem???
    Please help.
    Regards
    Gaurav Raghav
    Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 4:09 PM

    Hey Gaurav,
    Can you please tell me how did u solve the problem ..
    i am also currently facing the same situation..please help me..
    Regards,
    Jessica Sam

Maybe you are looking for

  • Multiple monitors on laptop: iTunes crashes upon display lock

    I have a laptop running XP Pro with an external monitor attached as an extended desktop. When I use iTunes (6.0.5.20) and lock my screen for any reason (close lid, screen saver activates, etc.), iTunes freezes and throws up an "Unsupported Display" w

  • Table content hover, background color change

    How can I achieve this background color hover effect? Like the table on this page: http://uconn.edu/holiday/teams.html

  • Inbound Async Java Proxy

    I am using an Inbound Async Java Proxy to send via socket three strings, via SXMB_MONI and RWB->MM->MDT I can see message was successfully delivered to JP System that for me is the XI J2EE engine, the JP is not sending anything (the logic is very sim

  • How could I config a Delivery Notes for a shipping point ?

    Hi Experts! I need to config a new delivery notes especially to tie a shipping point and a revenue channel...do you know how to proceed?? Actually, my client already have a delivery note for a shipping point and a revenue channel, but now I need to c

  • We are getting ODBC Error while connection to Universe?

    HI, While creating a report i am getting following error. Please give me solution for that.