Path specification problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • uhdam
    New Member
    • Mar 2009
    • 50

    Path specification problem

    Hi...

    i have an xml file and from that i need to refer to the dtds...

    In my system the dtd path accepts only if it is set as
    "/c:/Documents and settings/.... "

    but by default it has to be set as "c:/documents and settings/..."

    And because of this when i get absolute path and assign the value for opening a file or saving a file it shows error and i couldnt get the needed output.

    How to resolve.... what has to be done and why is this so....

    Thank you..
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    I don't understand the parts
    In my system the dtd path accepts only if it is set as
    "/c:/Documents and settings/.... "
    and
    but by default it has to be set as "c:/documents and settings/..."
    Why don't you post what you have tried and the error message that you got.

    Comment

    • uhdam
      New Member
      • Mar 2009
      • 50

      #3
      the error i got was null pointer.. i am sure that the path has to be set without the / in front... but it does not accept so...

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Like I said, post the code you used before and including the line reported for the nullpointer exception.

        Comment

        • uhdam
          New Member
          • Mar 2009
          • 50

          #5
          i got MalformedURL exception: protocol c

          Comment

          • uhdam
            New Member
            • Mar 2009
            • 50

            #6
            When i run my project it runs to certain extent and when it needs the support of dtd and xml it fails at that stage.

            It returns error in console as
            C:/Documents%20and %20Settings/Uhdam/Prj/src/xmldet/xmlinfo.xml

            java.lang.NullP ointerException

            Comment

            • JosAH
              Recognized Expert MVP
              • Mar 2007
              • 11453

              #7
              Originally posted by uhdam
              i got MalformedURL exception: protocol c
              You can't use an absolute file path as a URL; you have to use something like:

              "file:///c:/path/to/your/file"

              The first part is the protocol (your error message showed 'c', indicating that your drive designator was used as the protocol); the additional slashes are URL syntax plus path separators.

              kind regards,

              Jos

              Comment

              • uhdam
                New Member
                • Mar 2009
                • 50

                #8
                Sir the dtd definition file path is to be mentioned in xml file na. in the top of xml file where i need to specify the dtd file path if i give the path as

                "C:/Documents and settings/Uhdam/Prj/src/Parser/dtdefintion.dtd " it shows me error and specifies that it should be in the format as below

                "/C:/Documents and settings/Uhdam/Prj/src/Parser/dtdefintion.dtd "

                So when i use methodname.getA bsolutePath(); it returns an error because it wouldnt consider the / in front of drive name by default.

                What to do to make the system recognize without slash in front of drive name.

                Comment

                • JosAH
                  Recognized Expert MVP
                  • Mar 2007
                  • 11453

                  #9
                  Did you try my suggestion? Your software wants a URL and you're not supplying a valid URL, i.e. you are supplying a file path.

                  kind regards,

                  Jos

                  ps. don't PM me nor try to hurry me; this problem may be urgent to you but it isn't to us nor is your problem more important to us than the other problems posted in this forum.

                  Comment

                  Working...